早教吧作业答案频道 -->其他-->
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编程问题,实在是...的网友还看了以下:
has been so closely connected with the developmen 2020-05-13 …
对美国独立宣言的英语问题对When in the Course of human events,i 2020-05-14 …
1._____(take) an online tour,you need a computer 2020-05-15 …
英语翻译Railway reaches China's easternmost countyHAR 2020-05-16 …
I have read this novel alreadyThis novel __ __ __ 2020-05-16 …
英语翻译1.How does replacing a hub with a switch affe 2020-05-17 …
A network administrator issues the ping 192.168.2. 2020-05-31 …
A technician is troubleshooting a host connectivit 2020-05-31 …
Th efollowing access list below was applied outbou 2020-05-31 …
matlab编程问题,实在是不会,希望大家能帮我解决,Write a program which 2020-06-27 …