y = cuberoot of (x-1) graph in matlab

To plot a graph of y = cuberoot of (x-1) in MATLAB, you can use the following code:

main.m
% Define the range of x values
x = -10:0.1:10;

% Apply the function to each element of x
y = (x-1).^(1/3);

% Plot the graph
plot(x,y);

% Label the x and y axes
xlabel('x');
ylabel('y');
189 chars
13 lines

This code creates a range of x values from -10 to 10, applies the cuberoot function to each x value (subtracting 1 first) to calculate the corresponding y value, and then plots the resulting graph using the plot function. The x and y axes are also labeled using the xlabel and ylabel functions, respectively.

When you run the code, you should see a graph of y = cuberoot of (x-1) with x ranging from -10 to 10.

gistlibby LogSnag