Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Getting an error: Attempted to access u(2); index out of bounds because numel(u)=1. Error in ==> treat at 31 if (u(2)>1000)

Subject: Getting an error: Attempted to access u(2); index out of bounds because numel(u)=1. Error in ==> treat at 31 if (u(2)>1000)

From: gati

Date: 12 Feb, 2013 16:07:17

Message: 1 of 1

HI,
 I am using an ode function having three differntial equations in u(1), u(2), (3) using function f=treat(t, u), Now when i use if function as if (u(2)>1000) c=1; else (u(1)<=100) c=0; end i am getting the following error Attempted to access u(2); index out of bounds because numel(u)=1. Error in ==> treat at 31 if (u(2)>1000) Please tell me. thanks

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us