Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

array errors using n

2 vues (au cours des 30 derniers jours)
Robert Tapia
Robert Tapia le 23 Juin 2020
Clôturé : MATLAB Answer Bot le 20 Août 2021
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]

Réponses (1)

madhan ravi
madhan ravi le 23 Juin 2020
Modifié(e) : madhan ravi le 23 Juin 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 commentaires
Robert Tapia
Robert Tapia le 23 Juin 2020
i'm using matlab r2019b thru a remote server
madhan ravi
madhan ravi le 23 Juin 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.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by