n range between 1 to 7 and d's range between 1 to 100. how to solve it?

1 visualización (últimos 30 días)
clc
clear all
n=[1:.0001:7];
d= ?? ;
[a]=d*n; display([a]

Respuesta aceptada

Star Strider
Star Strider el 9 de Feb. de 2015
I’m not certain what you want to do, but this may be one approach:
n = [1:.0001:7];
d = linspace(1, 100, length(n));
a = n.*d;

Más respuestas (1)

Stephen23
Stephen23 el 9 de Feb. de 2015
Editada: Stephen23 el 9 de Feb. de 2015
Try this:
>> n = 1:.0001:7;
>> d = linspace(1,100,numel(n));
And I suspect that you actually want to multiply with element-wise multiplication:
>> a = d.*n;
Depending on what kind of spacing you want you might like to look as colon and logspace .

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by