How can i leave the vector result?

I have a problem I need a result dB(2)=7 but that result coming. What will i do?
A(1)=4;
A(2)=5;
A(3)=6;
row=2; %row is variable. It is given one.
dB(row)=A(row)+2
dB =
0 7
I need result with brackets like that dB(1), dB(2), dB(3). But it is changed to vector.
Is there another way?
Thanks!

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jun. de 2013
If you need dB(2)=7 write
dB(2)=7
If not provide more information

5 comentarios

Light
Light el 8 de Jun. de 2013
Editada: Light el 8 de Jun. de 2013
I edited it again. If u want to know clearly, i will try again. Help me
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jun. de 2013
What are you expecting as result?
Light
Light el 8 de Jun. de 2013
All result is changed dB= ........
My expected result must have brackets dB(n)=......
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jun. de 2013
Editada: Azzi Abdelmalek el 8 de Jun. de 2013
What you are asking for is how to display B(n)=
row=2
dB(row)=A(row)+2;
[sprintf('dB(%d)=',row) num2str(dB(row))]
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jun. de 2013
Have you tried the above code? and what do you mean: use it next calculation? can you explain?

Iniciar sesión para comentar.

Categorías

Más información sobre Elementary Math en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Jun. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by