How can i leave the vector result?

3 次查看(过去 30 天)
Light
Light 2013-6-8
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!

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-6-8
If you need dB(2)=7 write
dB(2)=7
If not provide more information
  5 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-6-8
编辑:Azzi Abdelmalek 2013-6-8
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 2013-6-8
Have you tried the above code? and what do you mean: use it next calculation? can you explain?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by