eval_vector

Eval_vector - y Dependent variable Evaluate with vectors t =-9:0.5:9 test = t> 0 y(test =-3 t(test.^2 5 y(~test = 3 t(~test.^2 5 fplot(t,y(test)

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Program eval_vector.m % % Purpose: % This program evaluates the function over % the range -3 to 3 in increments of .5, using vectors. % % Define variables: % ii -- Loop index % t -- Independent variable % test -- Logical array for masking
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % y -- Dependent variable % % Evaluate with vectors % t = -9:0.5:9; test = t > 0; y(test) = -3 * t(test).^2 + 5; y(~test) = 3 * t(~test).^2 + 5; fplot(t,y(test))...
View Full Document

This note was uploaded on 11/09/2011 for the course CVEN 489 taught by Professor Staff during the Spring '08 term at Texas A&M.

Ask a homework question - tutors are online