Info

この質問は閉じられています。 編集または回答するには再度開いてください。

plotting a graph on matlab

4 ビュー (過去 30 日間)
Prakriti Biswas
Prakriti Biswas 2020 年 8 月 30 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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?

回答 (1 件)

KSSV
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 件のコメント
Prakriti Biswas
Prakriti Biswas 2020 年 8 月 30 日
Alright, could you help me plot the same thing for a range of 0 to infinity?
KSSV
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!

Translated by