plot x+y=69 in matlab

To plot a linear equation like x+y=69 in MATLAB, you can create a vector of x values, calculate the corresponding y values using the equation, and then plot the points. Here's the code to do that:

main.m
% Create a vector of x values
x = 0:0.1:69;

% Calculate the corresponding y values
y = 69 - x;

% Plot the points
plot(x, y);

% Add labels and title
xlabel('x');
ylabel('y');
title('Plot of x+y=69');
202 chars
14 lines

This code creates a vector of x values from 0 to 69 in steps of 0.1, calculates the corresponding y values using the equation y=69-x, and then plots the points using the plot function. Finally, it adds labels and a title to the plot.

Note that this will plot a line, because it's a linear equation. If you want to plot a curve, you'll need a different equation.

gistlibby LogSnag