필터 지우기
필터 지우기

I need some help with the linspace function

조회 수: 1 (최근 30일)
Fernanda
Fernanda 2022년 10월 13일
답변: Benjamin Drewry 2022년 10월 19일
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
Torsten
Torsten 2022년 10월 13일
편집: Torsten 2022년 10월 13일
We don't know what diff_M is.
But note that if length(v) = n, length(diff(v)) = n-1.
Sai
Sai 2022년 10월 18일
Can you provide the 'diff_M' data so that I could try from my end?

댓글을 달려면 로그인하십시오.

답변 (1개)

Benjamin Drewry
Benjamin Drewry 2022년 10월 19일
Replace 'diff' with 'gradient' to prevent vector mismatches and errors to the plot call

카테고리

Help CenterFile Exchange에서 R Language에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by