MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Light
on 8 Jun 2013

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!

*No products are associated with this question.*

Answer by Azzi Abdelmalek
on 8 Jun 2013

If you need dB(2)=7 write

dB(2)=7

If not provide more information

Show 2 older comments

Light
on 8 Jun 2013

All result is changed dB= ........

My expected result must have brackets dB(n)=......

Azzi Abdelmalek
on 8 Jun 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
on 8 Jun 2013

Have you tried the above code? and what do you mean: use it next calculation? can you explain?

## 1 Comment

## Azzi Abdelmalek (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/78427#comment_153735

Can you explain?