MATLAB: Is this code giving me an error

biomedicalmathematicsMATLAB

Error using plot
Error in color/linetype argument.
Error in garcia (line 65)
figure(2);hold off;plot(x_plot,m_plot,'1');hold on;

Best Answer

The problem is that you are using the Octave code rather than the MATLAB code for figure(2):
CURRENT CODE:
% Octave

figure(2);hold off;plot(x_plot,m_plot,'1');hold on;
plot(x_plot,n_plot,'2');plot(x_plot,h_plot,'3');
xlabel('Tiempo (ms)'); ylabel('Variables de membrana');
% Matlab

% figure(2);hold off;plot(x_plot,m_plot,'b');
% hold on;plot(x_plot,n_plot,'black');
% plot(x_plot,h_plot,'r');xlabel('Tiempo'); ylabel('Tau');
CHANGE IT TO:
% Octave
% figure(2);hold off;plot(x_plot,m_plot,'1');hold on;
% plot(x_plot,n_plot,'2');plot(x_plot,h_plot,'3');
% xlabel('Tiempo (ms)'); ylabel('Variables de membrana');
% Matlab
figure(2);hold off;plot(x_plot,m_plot,'b');
hold on;plot(x_plot,n_plot,'black');
plot(x_plot,h_plot,'r');xlabel('Tiempo'); ylabel('Tau');
xlabel('Tiempo (ms)'); ylabel('Variables de membrana');
and you should have no problems.