Info

此问题已关闭。 请重新打开它进行编辑或回答。

array errors using n

1 次查看(过去 30 天)
Robert Tapia
Robert Tapia 2020-6-23
关闭: MATLAB Answer Bot 2021-8-20
still new to matlab, so I'm asked to create an array from -5n to 5n with increments of n/100.
im not sure how to properly incorporate n into the array.
Array = [-5n: n/100: 5n]

回答(1 个)

madhan ravi
madhan ravi 2020-6-23
编辑:madhan ravi 2020-6-23
n = 3; % a number
Array = -5*n: n/100: 5*n % you were close
% or perhaps
syms n
Array = -5*n: n/100: 5*n
  6 个评论
Robert Tapia
Robert Tapia 2020-6-23
i'm using matlab r2019b thru a remote server
madhan ravi
madhan ravi 2020-6-23
Try this:
Array = @(n) -5*n: n/100: 5*n
If you don’t think this is what you want , nothing in MATLAB can give what you want.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by