photo

Hossein


Active since 2011

Followers: 0   Following: 0

Message

Hi,

I am using odeXXX for solving a simple ordinary equation. I need to have the solution in different times. For doing so, I though I only need a time span like
timespan=linspace(0,45E-6,88)
but the number of outputs does not have any correlation with the size of timespan

timespan=linspace(0,45E-6,88);
sol=ode45(handle,timespan,y0)

so I am expecting to see 88 answer in the output, but depending on the 'RelTol' the number of output is something about 24 to 290

right now I am using a for loop like this,

for i=1:size(timespan)
sol=ode45(handle, [0 timespan(i)],y0)
y=sol.y(:,end)
end

I am sure there must be a much better and faster way to obtain these results.

Statistics

MATLAB Answers

1 Question
4 Answers

RANK
3,720
of 300,618

REPUTATION
14

CONTRIBUTIONS
1 Question
4 Answers

ANSWER ACCEPTANCE
0.0%

VOTES RECEIVED
1

RANK
 of 21,030

REPUTATION
N/A

AVERAGE RATING
0.00

CONTRIBUTIONS
0 Files

DOWNLOADS
0

ALL TIME DOWNLOADS
0

RANK

of 169,839

CONTRIBUTIONS
0 Problems
0 Solutions

SCORE
0

NUMBER OF BADGES
0

CONTRIBUTIONS
0 Posts

CONTRIBUTIONS
0 Public Channels

AVERAGE RATING

CONTRIBUTIONS
0 Highlights

AVERAGE NO. OF LIKES

  • Knowledgeable Level 1
  • First Answer

View badges

Feeds

View by
No Activity