receiving error when code is correct on matlab onramp Project - Stellar Motion II task 4?
이전 댓글 표시
my code:
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
It says incorrect for "Did you make a plot with seven line?" and I did? How can I fix this?
답변 (5개)
Devaraj Malladad
2023년 11월 8일
i used below code got result all Pass
if not working, do multiple times of run and logout and login the cource . it amy work
for v = 1:7
s = spectra(:,v);
1<=1
if speed(v) <=0
plot(lambda,s,"--")
end
hold on
end
Abhishek Chakram
2022년 6월 20일
편집: Abhishek Chakram
2022년 6월 20일
Hi Alyssa,
I understand that you are facing issue in completing the Project - Steller Motion II, task 4.
To my understanding, in the 4th task you are just required to plot graph with LineWidth 3, you need not to specify the type of line (here, dashed line)
You can refer to the following code:
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;
댓글 수: 3
Umair
2022년 11월 27일
this dosent fix the problem
Sai Krishna Kiriti
2024년 1월 9일
I t says in incorrect
David
2024년 2월 26일
I'm currently facing similar problem. Were you able to solve it?
Mohammed amine
2023년 11월 18일
0 개 추천
EXERCICE
Modifiez la ligne 2 du script. Supprimez (:,2) pour calculer la vitesse de toutes les étoiles.
댓글 수: 2
Mohammed amine
2023년 11월 18일
Projet finalProjet - Mouvement stellaire II tasks 2-4
Ismail
2025년 1월 24일
s = spectra(:,2)
[sHa,idx] = min(spectra)
lambdaHa = lambda(idx)
z = (lambdaHa/656.28) - 1
speed = z*299792.458
I cannot go further beyond this point. Many thanks.
Use the code snippet below in [Task 2-4]
for c = 1:7
s = spectra(:,c);
if speed(c) <= 0
loglog(lambda, s, "--")
else
loglog(lambda, s, "LineWidth", 3)
end
hold on
end
hold off
xlabel('Wavelength') % Adding label for x-axis
ylabel('Intensity') % Adding label for y-axis
Prachi
2024년 12월 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
카테고리
도움말 센터 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!