how to solve blueshift

for c = 1:7
s = spectra(:,c);
loglog(lambda,s,"--")
if speed(c) <= 0
end
hold on
end
this is showing an error.plz help to solve it

6 件のコメント

Ameer Hamza
Ameer Hamza 2020 年 5 月 22 日
What is the error? Can you attach the value of variables? What is the purpose of if block?
HARPREET KAUR
HARPREET KAUR 2020 年 5 月 22 日
The answer was not accepting variable s along y axis
Bjorn Gustavsson
Bjorn Gustavsson 2020 年 5 月 22 日
For us to help you to resolve your prolem you'll have to submitt the error-message, preferably also the output from the whos command executed just before the loop.
One thing older versions of matlab never accepted is the "--" - it should be '--', i.e. single-quoutes.
Priyanka Vyas
Priyanka Vyas 2024 年 2 月 9 日
for v = 1:7
s = spectra(:,v);
if speed(v<= 0)
plot(lambda,s,'--')
else
plot(lambda,s,"LineWidth",3)
end
hold on
end
hold off
This command showing error
Priyanka Vyas
Priyanka Vyas 2024 年 2 月 9 日
What is wrong in above code? due to this I am not able to complete on ramp certification...
Walter Roberson
Walter Roberson 2024 年 2 月 9 日
v is in the range 1 to 7. This is never less than or equal to 0, so speed(v<=0) is going to be empty. Testing an empty variable gives a false result. The effect is as if you had
for v = 1:7
s = spectra(:,v);
plot(lambda,s,"LineWidth",3)
hold on
end
hold off
This assumes that spectra(:,v) exists and that speed() is a variable... if speed is a function then it would have to accept a single logical parameter.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

製品

リリース

R12.1

タグ

質問済み:

2020 年 5 月 22 日

コメント済み:

2024 年 2 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by