Undefined function 'setPlotProp' for input arguments of type 'struct', why showing this error?

Hi,
I am getting error ,"Undefined function 'setPlotProp' for input arguments of type 'struct'".
I am attaching code below:
x=42.63;
y= tand(x)^2;
ZL_1=40;
ZL_2=60;
ZL_3=80;
ZL_4=100;
Zv=30:10:150;
Z1_1=(sqrt(ZL_1*[Zv.*(1+y)-ZL_1]))./tand(x);
Z1_2=(sqrt(ZL_2*[Zv.*(1+y)-ZL_2]))./tand(x);
Z1_3=(sqrt(ZL_3*[Zv.*(1+y)-ZL_3]))./tand(x);
Z1_4=(sqrt(ZL_4*[Zv.*(1+y)-ZL_4]))./tand(x);
plot(Zv, Z1_1);
hold on;
plot(Zv, Z1_2);
hold on;
plot(Zv, Z1_3);
hold on;
plot(Zv, Z1_4);
hold on;
opt = [];
opt.Colors = [
1, 0, 0;
0, 0, 1;
1 0, 1;
0, 1, 0;
];
opt.LineWidth = [2,2,2,2];
opt.XLabel = 'Z_V (\Omega)';
opt.YLabel = 'Z_1 (\Omega)';
opt.YLim = [30, 150];
opt.YTick = [30:10:150];
opt.AxisLineWidth=1;
opt.XLim = [30, 150];
opt.XTick = [30:10:150];
opt.Markers = {'o','^','s','d'};
opt.MarkerSpacing = [1, 2, 3, 4];
opt.Legend = {'Z_L=40 \Omega','Z_L=60 \Omega','Z_L=80 \Omega','Z_L=100 \Omega'};
opt.LegendLoc='best';
opt.LegendBox='off'
opt.BoxDim = [3,2];
opt.FontSize = 10;
opt.YGrid = 'off';
opt.XGrid = 'off';
opt.FileName = 'Virtual_Impedance_behavior.png';
setPlotProp(opt);
I am not able to resolve this error.
Thanks in advance

2 comentarios

Why do you expect that this function should exist? Have you donwloaded it from somewhere?
No, I have not downloaded. Since, it is working code on one machine so I also tried on my machine.

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Abr. de 2018
Editada: Walter Roberson el 10 de Abr. de 2018

3 comentarios

Thank you for your answer, but its not working.
You have to install that software and add it to your MATLAB path using pathtool

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 9 de Abr. de 2018

Comentada:

el 10 de Abr. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by