I need some help with the linspace function
Show older comments
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)
Answers (1)
Benjamin Drewry
on 19 Oct 2022
0 votes
Replace 'diff' with 'gradient' to prevent vector mismatches and errors to the plot call
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!