Info
此问题已关闭。 请重新打开它进行编辑或回答。
plotting a graph on matlab
5 次查看(过去 30 天)
显示 更早的评论
Hi I'm trying to plot a graph on MATLAB for the steady state armature current with respect to the frequency coeffiecient B. I need to graph it for a range of B from 0 to infinity. I tried the code:
clc;
clear all;
k=input('Enter constant k');
Ra=input('Enter resistence Ra');
for B=0:007
x=(Ra*B)+(k*k);
iss=B/x;
plot(B,iss)
xlabel('B')
ylabel('iss')
end
But the graph is empty. What should I do?
0 个评论
回答(1 个)
KSSV
2020-8-30
编辑:KSSV
2020-8-30
Read about element by element operations in MATLAB.
clc;
clear all;
k=input('Enter constant k');
Ra=input('Enter resistence Ra');
B=0:007
x=(Ra*B)+(k*k);
iss=B./x;
plot(B,iss)
xlabel('B')
ylabel('iss')
2 个评论
KSSV
2020-8-30
As there is no way to represent the infinity in codes..you make your required number B very high..may be you can use:
db = 1. ; % the step size
B = 0:db:10^3 ;
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!