I am fairly new to Matlab and thought of using it for one project to plot some graphs. Problem is it requires Macaulay's notation. At the moment I've come up with a function file like this:
function [ V ] = Untitled2( x )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here;
Now, it gives the correct values for the shear force V whenever I add a specific coordinate x, however I can't think of a way for it to plot all the points. To be more precise I need it to be at V= 632.568 up until x=0.76, then it should go down straight to V= -2090.455 up until x=0.99 and then return to 0.
If any advice could be given about how to plot such a graph (or make better use of Matlab for Macaulay's notation) I would really appreciate!
No products are associated with this question.
Remove the plot() statement. Then in a new driver routine use
V = arrayfun(@Untitled2, x); %x can be a vector plot(x, V);
function [ V ] = Untitled2(x) V = zeros(size(x)); V(x<=.76) = 632.568; V(x>.76 & x<=.99) = -2090.455;
Now, from the command line:
x = 0:.001:1.5; plot(x,Untitled2(x))
Also, why not name your function some useful name, like:
function V = shearforce(x) V = zeros(size(x)); V(x<=.76) = 632.568; V(x>.76 & x<=.99) = -2090.455;
This 'Untitled2' business is just awful!
Play games and win prizes!Learn more