Error using plot Vectors must be the same length. ı have a plot error .İs there any advicethis problem
Afficher commentaires plus anciens
figure(3)
N1=linspace(2000,3400);
p = polyfit(Nwot,bsfcwot,2);
bsfc1=polyval(p,N1);
p1=plot(N1,bsfc1);
hold on;
xlim([2200 3400])
ylim([0 0.5])
hold on;
indexmin = find(min(bsfc1) == bsfc1);
Nbsfcmin = N1(indexmin)
bsfcmin = bsfc1(indexmin)
plot([Nbsfcmin ],[bsfcmin 0 ],'r--')
hold on;
plot([0 Nbsfcmin],[ bsfcmin 0],'r--')
Error in Untitled3 (line 219)
plot([Nbsfcmin ],[bsfcmin 0 ],'r--')
Réponses (1)
Cris LaPierre
le 3 Avr 2022
Modifié(e) : Cris LaPierre
le 3 Avr 2022
There are not enough details to say why your vectors are not the same length, but your X and Y vectors are not the same length in one of your plot commands. You must have an X and Y value for each element.
% works
plot([1 2],[2 5])
% doesn't work
plot([1 2],[2 5 8])
Catégories
En savoir plus sur Vehicle Dynamics Blockset dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
