MATLAB Answers


how to display answer in a particular format

Asked by Elysi Cochin on 18 Mar 2013

on calculation i obtain a value as

    0.2957             0.5700             0.8637             0.9657          
       0.1917                  0 + 0.1514i        0 + 0.4231i        0 + 0.5181i

if it contains real and imaginary part i want only the value 0.1514 to be stored in a variable.... how to do that....




No products are associated with this question.

1 Answer

Answer by Image Analyst
on 18 Mar 2013
 Accepted answer

yourVariable = imag(value(6)); % Get imaginary part of element #6.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!