早教吧作业答案频道 -->其他-->
matlab编程问题,实在是不会,希望大家能帮我解决,Write a program which determines the resistance of two resistors connected either in series or parallel.The program should prompt the user for the values of each resistor,and then ask whe
题目详情
matlab编程问题,实在是不会,希望大家能帮我解决,
Write a program which determines the resistance of two resistors connected either in series or parallel.The program should prompt the user for the values of each resistor,and then ask whether they are connected in series (‘s’) or parallel (‘p’).The formula for total resistance is:
Rseries = R1 + R2
Rpar = (R1*R2)/(R1+R2)
Write a program which determines the resistance of two resistors connected either in series or parallel.The program should prompt the user for the values of each resistor,and then ask whether they are connected in series (‘s’) or parallel (‘p’).The formula for total resistance is:
Rseries = R1 + R2
Rpar = (R1*R2)/(R1+R2)
▼优质解答
答案和解析
我英语不太好,理解上面的意思是,先输入两个电阻值,然后选择串并联,计算结果.
水平有限,不知是否符合你的要求,怀着助人为乐的心来的.
程序如下:
R1=input('请输入R1:');
R2=input('请输入R2:');
connect=input('请输入连接方式(s/p):','s');
switch connect
case 's'
R=R1+R2;
fprintf('串联电阻值为:%f\n',R);
case 'p'
R=R1*R2/(R1+R2);
fprintf('并联电阻值为:%f\n',R);
end
水平有限,不知是否符合你的要求,怀着助人为乐的心来的.
程序如下:
R1=input('请输入R1:');
R2=input('请输入R2:');
connect=input('请输入连接方式(s/p):','s');
switch connect
case 's'
R=R1+R2;
fprintf('串联电阻值为:%f\n',R);
case 'p'
R=R1*R2/(R1+R2);
fprintf('并联电阻值为:%f\n',R);
end
看了 matlab编程问题,实在是...的网友还看了以下:
关于宋·理学家程颢的一个不是问题的问题...程颐叫“伊川先生”是因为他宅处伊川,请问程颢为什么称“明 2020-03-31 …
求助MATLAB中最小二乘法拟合程序我有六组数据(X1,Y1),(X2,Y2),(X3,Y3),( 2020-05-16 …
he spends at least as much time reading as he doe 2020-05-16 …
在软件质量要素中,对未授权人员访问程序或数据加以控制的程度指的是()。 2020-05-31 …
()是程序的秘密入口点,它使得知情者可以绕开正常的安全访问机制而直接访问程序。 2020-05-31 …
英语(短信题问,请认真答)请问Howmuch问程度有哪些用法,能问哪些词的程度?How(much) 2020-06-14 …
是不是所有询问程度的句子都用howwell问?比如你有多喜欢弹琴是不是Howwelldoyouli 2020-07-09 …
程先生买了一套总价为80万元住房,首付30万元,其余50万元向银行申请贷款,贷款月利率0.5%,从 2020-07-26 …
阅读下列图文,回答问题。材料一下图为宋代著名理学家程颐(1032—1085)。有人曾问程颐:“寡妇贫 2020-12-03 …
程控放大器中的程控如何解释?各位高手请问程控放大器中的程控如何解释?它是过程控制的缩写或者是程序控制 2020-12-05 …