linspace returning 1 value
古いコメントを表示
Tmax = 1000;
Tc = linspace(487.87,Tmax)
when running the script, Tc is set to just the Tmax value but should be returning 100 evenly spaced values.
回答 (1 件)
Image Analyst
2021 年 11 月 24 日
You need to give linspace() the number of points, like
Tmin = 487.87;
Tmax = 1000;
numPoints = 100;
Tc = linspace(Tmin, Tmax, numPoints)
4 件のコメント
Christopher Redard
2021 年 11 月 24 日
編集済み: Image Analyst
2021 年 11 月 24 日
Image Analyst
2021 年 11 月 24 日
編集済み: Image Analyst
2021 年 11 月 24 日
How is that possible?
Tcompressor1 = 487.85;
nums = 100;
Tmax = 1000;
Tcombustor = linspace(Tcompressor1,Tmax,nums)
As you can see, it returns 100 values, not just the single Tmax value.
Christopher Redard
2021 年 11 月 24 日
Image Analyst
2021 年 11 月 24 日
Maybe you forgot to click the run button. If you do, it will run identically each and every time. I've be extremely surprised if that same code ran one way in your old script and another way in your new script, my computer, and in MATLAB online.
So, since it's solved, can you click the "Accept this answer" link? Thanks in advance.
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!