array errors using n
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
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]
Antworten (1)
madhan ravi
am 23 Jun. 2020
Bearbeitet: madhan ravi
am 23 Jun. 2020
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 Kommentare
Robert Tapia
am 23 Jun. 2020
madhan ravi
am 23 Jun. 2020
See my edited answer
Robert Tapia
am 23 Jun. 2020
madhan ravi
am 23 Jun. 2020
Bearbeitet: madhan ravi
am 23 Jun. 2020
https://www.mathworks.com/help/symbolic/syms.html#description , yes it does require a Symbolic Toolbox, however if your University have access to MATLAB Online , you could try it there.
Robert Tapia
am 23 Jun. 2020
madhan ravi
am 23 Jun. 2020
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.
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!