Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在绘制这些句子时遇到问题
for Temp = 1:3 for Veg = 1:3 z = Temp * Veg; end end x = 1:9; plot(x,z)
我想绘制的值,z但我不知道出了什么问题。
z
你忘了给出z一个索引:
for Temp = 1:3 for Veg = 1:3 z((Temp-1)*3+Veg) = Temp*Veg; end end
你也可以让它更快一点,产生相同的结果:
z = (1:3)'*(1:3); z = z(:)';