什么是x = [ - 300:1.1:300]';意思?

问题描述 投票:1回答:1

在代码中:

x=[-300:1.1:300]'; 

我不明白单引号是什么。整条线是什么意思?

我认为这个语法意味着,x取值从-300到300,步长为1.1。

我的代码片段是:

x=[-300:1.1:300]';  
y=x;  
[X,Y]=meshgrid(x,y);  

我在这里绘制图表。

matlab
1个回答
1
投票

你的理解是正确的。单引号用于转置。它将x从行向量更改为列向量。可能meshgrid想要列而不是行。

© www.soinside.com 2019 - 2024. All rights reserved.