Error using plot Invalid data argument.

Why am I getting this message?? Error using plot, invalid data argument?
%% Tabulate Values
% Create x array
x = linspace(xmin, xmax, Nx);
% Create y array
y = cos((2*p*x)/(L));
%% Experimental Data
xexp = [1, 2, 3, 4, 5];
Trial1 = [0.38, -0.82, -0.79, 0.28, 0.93];
Trial2 = [0.36, -0.80, -0.88, 0.45, 1.10];
Trial3 = [0.22, -0.67, -0.94, 0.27, 0.98];
%% Plot Data
% Plot the x and y arrays.
plot(x, y, 'k-', 'LineWidth', 1, ...
xexp, Trial1, 'go(none)', ...
xexp, Trial2, 'rx(none', ...
xexp, Trial3, 'b*(none)' );
% Add axis labels
xlabel('x');
ylabel('y');
% Create title block
title( 'plotPractice' );

回答(2 个)

% Plot the x and y arrays.
plot(x, y, 'k-', 'LineWidth', 1, ...
xexp, Trial1, 'go', ...
xexp, Trial2, 'rx', ...
xexp, Trial3, 'b*' );
% Add axis labels
xlabel('x');
ylabel('y');
% Create title block
title( 'plotPractice' );

类别

帮助中心File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by