フィルターのクリア

Why is my linspace not working

20 ビュー (過去 30 日間)
Ryan Scott
Ryan Scott 2020 年 5 月 14 日
回答済み: Image Analyst 2020 年 5 月 14 日
x = linspace(2.5,5.8333,0.41667)
I enter this into mat lab, but for some reason this is what returns
1×0 empty double row vector
Im not sure why this is happening.

回答 (2 件)

Image Analyst
Image Analyst 2020 年 5 月 14 日
Cris explained it well. Perhaps you want this instead:
x = 2.5 : 0.41667 : 5.8333

Cris LaPierre
Cris LaPierre 2020 年 5 月 14 日
What is your expected output?
The 3rd input is the number of points you want the resulting vector to have. As such it must be a positive integer. If you do not specify a 3rd input, you get 100 points. Read the documentation for linspace to learn more.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by