MATLAB: I am getting Unbalanced or unexpected parenthesis or bracket

mask parameters intilizationsimulink

Actually i have written code in mask parameter in initialization and while i am applying i am getting error like unbalance or unexpected parenthesis or bracket so can please help me out of this problem…… i am using matlab 2014 version…. here is the code…
if PlotVI_Module
assignin('base', 'Voc', Voc);
assignin('base', 'Isc', Isc);
assignin('base', 'Rs', Rs);
assignin('base', 'Rp', Rp);
assignin('base', 'Isat', Isat);
assignin('base', 'Vt', Vt);
if PlotVI_Module,
F1 = figure('Name', 'IV and PV characteristics of a Module at 25 deg.c');
end
load_system('PV_Model_Param');
for ksun=1:-0.25:0.25
assignin('base', 'Iph', Iph*ksun);
sim('PV_Model_Param');
n=find(I_PV>=1);
I_PV=I_PV(n);
P_PV=V_PV.*I_PV;
if PlotVI_Module
figure(F1);
subplot(211)
if ksun==1
plot(V_PV, I_PV, 'b' (0 Vmp Voc), (Isc Imp 0), 'ro')
text(Voc/15, Isc*1.1, '1 Kw/m^2')
hold on
grid
else
plot(V_PV, I_PV, '--m')
text(Voc/15, Isc*(ksun+0.1), sprintf('%g Kw/m^2', ksun))
end
subplot(212)
if ksun==1
plot(V_PV, P_PV, 'b', (0 Vmp Voc), (0 Imp*Vmp 0), 'ro')
text(Vmp*1.02, Vmp*Imp, '1 Kw/m^2')
hold on
grid
else
n=find(P_PV==max(P_PV));
plot(V_PV, P_PV, '--m', V_PV(n), P_PV(n), 'mo')
text(Vmp*1.02, Vmp*Imp*ksun, sprintf('%g Kw/m^2', ksun))
end
subplot(211)
ylabel('Current (A)')
xlabel('Voltage (V)')
title('PV_Module')
axis_xy=axis;
axis_xy(4)=Isc*1.2;
axis(axis_xy);
subplot(212)
ylabel('Power (W)')
xlabel('Voltage (V)')
axis_xy=axis;
axis_xy(4)=Vmp*Imp*1.2;
axis(axis_xy);
set_param(BlockName,'PlotVI_Module', 'off')
end
end
end

Best Answer

This is no valid Matlab syntax:
plot(V_PV, I_PV, 'b' (0 Vmp Voc), (Isc Imp 0), 'ro')
% ^^^^^^^^^^^ ^^^^^^^^^^^
and
plot(V_PV, P_PV, 'b', (0 Vmp Voc), (0 Imp*Vmp 0), 'ro')
% ^^^^^^^^^^^ ^^^^^^^^^^^^^
What is the purpose of these lines? Perhaps you want to replace the round parentheses by square brackets for a horizontal concatenation, and insert a comma in the first case?
plot(V_PV, I_PV, 'b', [0 Vmp Voc], [Isc Imp 0], 'ro')
plot(V_PV, P_PV, 'b', [0 Vmp Voc], [0 Imp*Vmp 0], 'ro')