Error using plot Invalid data argument.
Show older comments
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' );
Answers (2)
KSSV
on 20 Aug 2020
% 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' );
madhan ravi
on 20 Aug 2020
0 votes
Remove (none)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!