# what does this Complex values are not supported mean?

10 views (last 30 days)
Juan José Martinez Parra on 23 Aug 2021
clear variables
clc
close all
MasaCarga = 400;
M = MasaCarga/2;
L = 1.4;
L1 = 0.5;
L2 = 1;
a = 0.8;
b = 2.5;
g = 9.8;
teta1 = acos((b-L1)/L);
teta2 = acos((b-L2)/L);
nDivisiones = 100;
teta = linspace(teta1,teta2,nDivisiones);
N = M*g*a./(L*cos(teta));
Ey = M*g*a./(L*cos(teta));
Dy = M*g*(1-a./(L*cos(teta)));
Fp = M*g*cot(teta);
Cy = M*g*(1-2*a./(L*cos(teta)));
Cx = -Fp;
Fy = M*g*(1-a./(L*cos(teta)));
Fx = -Fp;
colorazul = [0 0 153]/255;
colorvino = [153 51 102]/255;
xlabel('Angulo \alpha (°)')
ylabel('Fuerza (N)')
hold on
legend('boxoff')
legend('location','best')
set(gca,'fontsize',13)
figure()
xlabel('Angulo \alpha (°)')
ylabel('Fuerza (N)')
hold on
legend('boxoff')
legend('location','best')
set(gca,'fontsize',13)
figure()
xlabel('Angulo \alpha (°)')
ylabel('Fuerza (N)')
hold on
legend('boxoff')
legend('location','best')
set(gca,'fontsize',13)

Yazan on 23 Aug 2021
tetagrados is a vector of complex numbers. So, first of all, notice that the function plot throws a warning and plots only the real parts, ignoring the imaginary ones.
Second, in this line
You are asking Matlab to restrict the limits of the X-axis to the min and max of tetagrados. However, tetagrados is complex, the min and max functions will return complex numbers. How can you set the limits of an axis with complex numbers? You obviously can not. So, you have an error. You should decide to work with the real part, imaginary part, or absolute values.
example:
Juan José Martinez Parra on 23 Aug 2021
thank you so much

### Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!