Filter löschen
Filter löschen

I need some help with the linspace function

2 Ansichten (letzte 30 Tage)
Fernanda
Fernanda am 13 Okt. 2022
Beantwortet: Benjamin Drewry am 19 Okt. 2022
Hey everyone, so whenever I run my code I get "Error using plot Vectors must be the same length" so I tried using linspace but it's still not working. Could I get some help?
T = linspace(1,99,length(diff_M))
M = 1./T;
diff_M3 = diff(M3)
plot(diff_M,T)
  2 Kommentare
Torsten
Torsten am 13 Okt. 2022
Bearbeitet: Torsten am 13 Okt. 2022
We don't know what diff_M is.
But note that if length(v) = n, length(diff(v)) = n-1.
Sai
Sai am 18 Okt. 2022
Can you provide the 'diff_M' data so that I could try from my end?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Benjamin Drewry
Benjamin Drewry am 19 Okt. 2022
Replace 'diff' with 'gradient' to prevent vector mismatches and errors to the plot call

Kategorien

Mehr zu Performance and Memory finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by