f



ode45 & events : error in Matlab 7 SP1, oke in Matlab 6.5

I wrote a program some time ago, which was working fine with Matlab
6.5 . I've upgraded to Matlab 7(SP1) and now it's not running
anymore. I've getting an error while integrating a differential
equation.

I'm having the following error :

??? Error using ==> horzcat
All matrices on a row in the bracketed expression must have the
 same number of rows.

Error in ==> ode45 at 393
        teout = [teout, te]

Error in ==> flo_zoek_punt_doorsnede>controle at 211
    [tijd,trajectorie,te,ye,ie] = ode45(@opl_aantr,[0
teind],[startpunt],options,LIAP_INSTAB,LIAP_STAB);

It has something to do with the event function, but I don't know who
to solve it. Do I have to change something to my code?

Thanks

Liesbeth Luyckx

PS My code is the following :

options = odeset('event', @zoek_nul);
[tijd,trajectorie,te,ye,ie] = ode45(@opl_aantr,[0
teind],[startpunt],options,LIAP_INSTAB,LIAP_STAB);
------------------------------
function [value,isterminal,direction] =
zoek_nul(t,y,LIAP_AANTR,STAB_LIAP)

WAARDE = Liapunov1(y'); % Liapunov1 is a function

WA1 = WAARDE - LIAP_AANTR;
WA2 = WAARDE - STAB_LIAP;

value = [WA1; WA2];
isterminal = [0 ; 1];
direction=[0; 0];

-------------------------------
function out1 = opl_aantr(t,y,LIAP_AANTR,STAB_LIAP)

gegevens; % the parameter values are in this file
% g and mu_d are both functions
out1 = zeros(4,1);

out1(1) = y(2);
out1(2) = - 2 * dzeta1 * y(2) - g(y(1)) - g(y(1) - y(3)) -
mu_d(y(1));
out1(3) = y(4);
out1(4) = - 2 * dzeta2 * y(4) - g(y(3) - y(1));
0
liesbeth (2)
5/20/2005 2:30:43 PM
comp.soft-sys.matlab 211266 articles. 17 followers. lunamoonmoon (258) is leader. Post Follow

2 Replies
1634 Views

Similar Articles

[PageSpeed] 10

Liesbeth,

Your code is probably o.k -- there was a bug introduced in MATLAB 7.0 and 
fixed in SP2.

Take a look at our Technical Solution 1-QAZDS, available at
http://www.mathworks.com/support/solutions/data/1-QAZDS.html?solution=1-QAZDS

Hope that this fixes your problem.

Regards,
Jacek

--------------------

"Liesbeth Luyckx" <liesbeth@autoctrl.NOSPAM.UGent.be> wrote in message 
news:ef06a32.-1@webx.raydaftYaTP...
>I wrote a program some time ago, which was working fine with Matlab
> 6.5 . I've upgraded to Matlab 7(SP1) and now it's not running
> anymore. I've getting an error while integrating a differential
> equation.
>
> I'm having the following error :
>
> ??? Error using ==> horzcat
> All matrices on a row in the bracketed expression must have the
> same number of rows.
>
> Error in ==> ode45 at 393
>        teout = [teout, te]
>
> Error in ==> flo_zoek_punt_doorsnede>controle at 211
>    [tijd,trajectorie,te,ye,ie] = ode45(@opl_aantr,[0
> teind],[startpunt],options,LIAP_INSTAB,LIAP_STAB);
>
> It has something to do with the event function, but I don't know who
> to solve it. Do I have to change something to my code?
>
> Thanks
>
> Liesbeth Luyckx
>
> PS My code is the following :
>
> options = odeset('event', @zoek_nul);
> [tijd,trajectorie,te,ye,ie] = ode45(@opl_aantr,[0
> teind],[startpunt],options,LIAP_INSTAB,LIAP_STAB);
> ------------------------------
> function [value,isterminal,direction] =
> zoek_nul(t,y,LIAP_AANTR,STAB_LIAP)
>
> WAARDE = Liapunov1(y'); % Liapunov1 is a function
>
> WA1 = WAARDE - LIAP_AANTR;
> WA2 = WAARDE - STAB_LIAP;
>
> value = [WA1; WA2];
> isterminal = [0 ; 1];
> direction=[0; 0];
>
> -------------------------------
> function out1 = opl_aantr(t,y,LIAP_AANTR,STAB_LIAP)
>
> gegevens; % the parameter values are in this file
> % g and mu_d are both functions
> out1 = zeros(4,1);
>
> out1(1) = y(2);
> out1(2) = - 2 * dzeta1 * y(2) - g(y(1)) - g(y(1) - y(3)) -
> mu_d(y(1));
> out1(3) = y(4);
> out1(4) = - 2 * dzeta2 * y(4) - g(y(3) - y(1)); 


0
5/20/2005 4:08:22 PM
Thanks :-)

Liesbeth
0
liesbeth (2)
5/23/2005 8:14:21 AM
Reply:

Similar Artilces:

fsolve
Hi: I am using Matlab -7 and am using fsolve function. I needed to run this on a server that has Matlab 6.5 and it doesn't recognize fsolve. I read at <http://www.mathworks.com/support/solutions/data/1-15NRJ.html?product=OP&solution=1-15NRJ> that I need to declare an inline function. But I have the equations define in m file and I don't know how to use inline and still use the m file which has the equations defined. I am using the fsolve as shown below: [v,fval,ef1] = fsolve(@set_eqns_jacobn,v0,options); Please let me know how should I define inline function and define the ...

Matlab 6.5 to matlab 7
hi, i want to upgrade my Matlab 6.5 to Matlab7, will it cause any effects to the M-files that i saved before? Or do I need to uninstall the Matlab 6.5 first before installing the Matlab 7? regards, blur On Fri, 25 Feb 2005 13:03:13 +0000, Blur wrote: > hi, > i want to upgrade my Matlab 6.5 to Matlab7, will it cause any effects > to the M-files that i saved before? See http://www.mathworks.com/access/helpdesk/help/techdoc/rn/r14sp1_a.html for information on changes to the Matlab programming language that may affect old m-files. For the most part the changes are minor, and most ...

From Matlab 6.5 R13 to Matlab 7
Hello, Are there major incompatibilities between scripts/functions coded in Matlab 6.5 R13 and more recent versions (Matlab 7, and service packs) ? I'm using Matlab 6.5 R13 with image processing toolbox. I wonder if it's woth moving to Matlab 7, i.e. if I would have to write my code again or if everything is compatible. When Matlab 7 was released I heard some functions have been rearranged, and some R13 scripts didn't work. Is there a list somewhere of such incompatibilities ? Sorry if this question has been asked, I couldn't find it on these boards. Also I'm interested ...

MATLAB 6.5 Toolboxes in MATLAB 7
Hi, I'm quite tempted to upgrade my version of MATLAB 6.5 Student version to the latest v7. What I need to know is will the toolboxes that I've purchased for v6.5 will work in v7? Looking at the MATLAB web site, it doesn't seem to have updated the neural network toolbox, which is what I use. So will my current copy work with v7 or will I have to buy a new version? Thanks, Wee-Jin ...

converting matlab 7 files to matlab 6.5
Does anyone know if it is possible to convert Matlab 7 .mat and .fig files into a format which can be read by Matlab 6.5. Any help would be most appreciated!!! Ben Hi Ben, Try using the export feature within guide to save your .fig file as .m file. Matlab 7 guis have more properties than 6.5 so you will have to remove some of these manually before you can get your file to run Matlab 6.5. Regarding mat files... "SAVE ... -V6 saves a MAT-file that MATLAB 6 can LOAD." Regards, Bobby "Benjamin Bird" <benjamin_bird@hotmail.com> wrote in message news:ef0345d.-1@webx.raydaftYaTP... > Does anyone know if it is possible to convert Matlab 7 .mat and .fig > files into a format which can be read by Matlab 6.5. > > Any help would be most appreciated!!! > > Ben ...

TF in Matlab 7 vs Matlab 6.5
Hi, I was using the TF function sucessfully in Matlab 6.5 inorder to calculate a transfer function. However when i use the code with Matlab 7 i get an error, since the TF function seems to have changed. I need to use it with matlab 7 since i want to use the ilaplace function which I dont have on matlab 6.5. Any ideas? Its ft on the other one a**hole ! "Christopher White" <christopherwhite.is@gmail.com> wrote in message news:ef1be03.-1@webx.raydaftYaTP... > Hi, > I was using the TF function sucessfully in Matlab 6.5 inorder to > calculate a transfer function. Howeve...

Problem running exe compiled using Matlab Compiler 7.6 on a PC with Matlab 6.5
Hi, I have some Matlab code which I compiled using Matlab Compiler 7.6. Using the MCRInstaller and the Visual C++ Runtime library, I was able to install MCR 7.6 on the client machine. However, the client machine already had Matlab 6.5. Now when I try to run my exe, I get the following error message: Fatal error finding symbol mxCalcSingleSubscript_76 in c:\matlab6p5\bin\win32\libmx.dll I understand that the error shows up since the exe tries to go and look for the necessary information in the win32 folder for Matlab 6.5 rather than the v76 folder for the runtime. Can anyone give ...

Importing matlab 6.5 GUI in matlab 7.1
I use MATLAB 7.1. If I open an existing GUI project built in 6.5 MATLAB with GUIDE tool, .fig is loaded correctly but .m is not loaded (it has the same name of .fig), then when I run the GUI and click on buttons I got function not found errors: ??? Undefined command/function 'fsv'. ??? Error while evaluating uicontrol Callback. How can I reassociate .m with his .fig? ...

bar
In MatLab 6.5, the routine above works normal: figure; sem=Average(:,2)./sqrt(Average(:,3)); bar([1:1:7],Average(:,1),sem); ylabel('% of epochs analyzed') xlabel('Frequency Band') title ('Occurrence of Oscillatory Events - Ch X') %Where Average and sem are vectors; But, in MatLab 7.0, the same code cause the following error: ??? Error using ==> xychk Too many input arguments. Error in ==> bar at 53 [msg,x,y] = xychk(args{1:nargs},'plot'); Error in ==> cross_subj_analysis>ok_Callback at 327 bar([1:1:7],Average(:,1),sem); I'd like to know why this occour. Thanks Henrique In article <g7a1j6$l1$1@fred.mathworks.com>, Henrique Amaral <henriquetomaz@uol.com.br> wrote: >In MatLab 6.5, the routine above works normal: >figure; >sem=Average(:,2)./sqrt(Average(:,3)); >bar([1:1:7],Average(:,1),sem); >ylabel('% of epochs analyzed') >xlabel('Frequency Band') >title ('Occurrence of Oscillatory Events - Ch X') >%Where Average and sem are vectors; >But, in MatLab 7.0, the same code cause the following error: >??? Error using ==> xychk >Too many input arguments. >Error in ==> bar at 53 > [msg,x,y] = xychk(args{1:nargs},'plot'); >Error in ==> cross_subj_analysis>ok_Callback at 327 >bar([1:1:7],Average(:,1),sem); >I'd like to know why this occour. When the third argument is numeric, it must be the bar width. barwidth must b...

save in matlab 6 and load in matlab 6.5: how to?
Hi, I'm trying to load in matlab 6.5 a result file created in matlab 6.0 the syntax used in matlab 6 is just save file.mat; the syntax used for loading the file is load file.mat; As a result I have the following message: ??? Error using ==> load Unable to read MAT file C:\MATLAB6p5\work\file.mat File may be corrupt. File is not corrupt as it works if I load it using Matlab 6... Any suggestion? Thanks Thus spake <cuckoobird>: > Hi, > > I'm trying to load in matlab 6.5 a result file created in matlab 6.0 > > the syntax used in matlab 6 is just > ...

Problems with Matlab 6.5.1 R13 to Matlab 7 R14
I've written a GUI, with text in it. When I open it with Matlab 6.5.1 R13 there are no problems to show the full text for Matlab. But when I try it with Matlab 7 R14 the text is shown incomplete. This is because Matlab 7 prints the font bigger than Matlab 6.5.1... Is there a font, which is in the same size in Matlab 7 R14 AND Matlab 6.5.1 R13? Thanks ...

Using Matlab 6.5 To load Matlab 7.0 Figures
As suggested in my subject I am trying to use Matlab 6.5 to load a Matlab 7.0 updated .fig file. The command I am using is: hgload filename; the error I recieve is: ??? Error using ==> load Unable to read MAT file z:\xbr_prop\proptool\V7.0.6\PROP\xbr_tool_prop_fig3.fig See FILEFORMATS for a list of known file types and the functions used to read them. Error in ==> \\Resbed-easrv\MATLAB6p5\toolbox\matlab\iofun\hgload.m On line 45 ==> fileVars = load(filename,'-mat'); Error in ==> z:\xbr_prop\proptool\V7.0.6\PROP\prop_7_gui.m On line 2 ==> hgload xbr_tool_prop_fig3;...

load5
After lots of hunting around with old friends, I was able to locate Windows libraries of Matlab 6.5. In addition, I have put a couple "extras" into the load5 command. As soon as it appears in the file exchange (and i notice it), i will update the file to a .zip file which will contain both Windows and Linux versions of load5. Note that if you use this MEX file with R14 in linux, you will need to copy the libz.so.1.2.2 to either the matlab directory and modify the symbolic links libz.so and libz.so.1, or put it in your path and make sure the LD_LIBRARY_PATH has your directory prece...

Read Matlab 7 .mat files in Matlab 6.5 -- SOLUTION
Thank you Dan for the suggestion of topic change (from MAT file format R13 vs R14, Please Read even if you viewed other post). I have submitted a linux x86 version of the load5 to the File Exchange, i guess it will take a couple days to get up there. If you need it sooner, let me know. Also, still looking for the Windows versions of Matlab 6 dll's (libmx.dll, libmex.dll, libmat.dll) plus the .def files and the mexversion so I can compile in Windows. If you have these, please reply so I can set up a way to get them from you. Below is an example using the load5 mex function from linux. ...

Convert GUI of Matlab R2006a&b to Matlab 6.5
Could you please tell me how to convert a GUI application created in Matlab R2006a&b to executable file in Matlab 6.5? Thank you. ...

some problems of codes of MATLAB 7.0 working on MATLAB 6.5
I have used MATLAB for few hours.So I don't know the differences between version 6.5 and 7.0.I want to use some codes of MATLAB 7.0, but they doesn't work in MATLAB 6.5.How to change these codes so that they can work in matlab 6.5.Waiting for your help. Thank you . The codes are like this .I think changing the function findPI may work ,but I don'y know how % PIfun.m % Evaluate a function used to find the PI-line, using Kyle Champley's % method. % % Adam Wunderlich % last update: 5/18/06 function y = PIfun(r,R,h,gamma,x3,sb) temp = R - r*cos(gamma-sb); y = h*((pi - 2*atan(...

7.0 vs. 6.5: (matlab 7.0 does not work) question on using MSVC matlab add-in to generate m-dll to speed-up my program
Dear all, I was using Matlab 6.5 MSVC matlab add-in macro to generate m-MEX-dll used in Matlab for speeding-up my program. I created a new "matlab project" in MSVC 6.0. Then load the m-file "ProcessBitmap.m" which is the m-file I want to convert into MEX dll to use in the matlab command line. Then I built the "dll" file in MSVC 6.0. The generated "ProcessBitmap.dll" can be successfully used in matlab 6.5 command line without any trouble. It can be used inside the matlab command line. Even if I delete the original "m-file", the "ProcessB...

MATLAB 6 to MATLAB 7 changes
I am looking for information here on the MathWorks website about the changes between MATLAB 6 and MATLAB 7. Specifically, I am looking for information about changes in the handling of .mat files. For example if I have a mat-file: example.mat located in the MATLAB current directory. In MATLAB 7 I can load this data-file into the MATLAB workspace with: >> load example And it loads fine. If I type the above load command in MATLAB 6 I get and error. Is there anything that provides the technical information for this? Thanks Dave Dave wrote: > I am looking for information here on t...

problem with matlab compile error in matlab6.5 work in matlab 7, help!
hi to all, i have a problem running this code on Matlab 6.5, it running fine on matlab Version 7.1.0.183 (R14) Service Pack 3 (but i have not this version) Matlab 6.5 give me a compilation error: ?? Error: File: C:\Documents and Settings\Roby\Documenti\Tesi\portoni_sd_sa\portoni_sd_sa\portoni_2d.m Line: 23 Column: 19 "identifier" expected, "(" found. row 23 col 19 start from @(points) ... (at line begining with error_function = ) Can u help me to resolve this error? can u give me sugestion how can write this line i'm a beginner and i can't understand why t...

Matlab 5 vs Matlab 6
Are there any significant difference/s between Matlab 5 and 6? In article <ef0b5a4.-1@webx.raydaftYaTP>, "Timothy Ramos" <teej_ramos@yahoo.com> wrote: > Are there any significant difference/s between Matlab 5 and 6? Yes. Timothy Ramos wrote: > Are there any significant difference/s between Matlab 5 and 6? http://www.mathworks.com/access/helpdesk_r13/help/base/relnotes/matlab/rn.html -- Brad Phelan http://xtargets.com Timothy Ramos <teej_ramos@yahoo.com> wrote: > Are there any significant difference/s between Matlab 5 and 6? As others have said, ye...

different results in function regress from MATLAB 6.5 to MATLAB 7.0
Hello , anybody knows when I execute the function "regress" to this model (STAR(1)) Yt = 1 - 0-5Yt-1 - (4 + 0.4Yt-1)G(gamma*Yt-1) + et, where G(z) =1/ [1 + exp(-z)], gamma=4; et=N(0,1) I obtain different radically different results from matlab 6.5 to matlab 7.0 that with other models??Any suggestion to avoid this problem??? On May 25, 4:40=A0am, "Kun Aguero" <isildur20022...@yahoo.es> wrote: > Hello , anybody knows when I execute the function "regress" to this model= (STAR(1)) > Yt =3D 1 - 0-5Yt-1 - (4 + 0.4Yt-1)G(gamma*Yt-1) + et, where G(z) =3D1/ ...

Incompatible of MAT file for Matlab 6.5.1 and Matlab 7.0
Hi! I have recently installed Matlab 7.0. I have save my simulation results in .MAT file. However, these MAT files can't be opened using Matlab 6.5.1. I encountered problem as follows: ??? Error using ==> load Unable to read MAT file D:\MATLAB7\work\results.mat File may be corrupt. How can I solve this problem? Thanks. Linda Please see here: <http://tx.technion.ac.il/~perryb/matlab7/mat7.pdf> In short, save again as: The new features and enhancements are described in the "Release notes" of Matlab. A new feature that causes incompat...

Matlab 6.5.1 slower than Matlab 5.3
Hello everyone, i've just installed Matlab 6.5.1 on my desktop (2.8 GHz 1GB RAM) but when I compare its performance to an older version: Matlab 5.3 the new version is about 3.7 times slower. Running a certain m-file in 5.3 takes about 27 seconds, while running exactly the same m-file in Matlab 6.5.1 takes about 102 seconds (using tic toc). Can anyone tell me if this is normal (why then?) ? And if so why would I wanna use the newer version if it is that much slower? Ron Yes this is correct. After 5.3, Matlab and Simulink are running much much slower. Twice the execution time is typical a...

Re: Incompatible of MAT file for Matlab 6.5.1 and Matlab 7.0
You can find a file converter here: <http://www.codebuildingblocks.com/MatVersionConverter/> ...

Web resources about - ode45 & events : error in Matlab 7 SP1, oke in Matlab 6.5 - comp.soft-sys.matlab

Portal:Current events - Wikipedia, the free encyclopedia
Reports suggest a U.S. agent, working for the U.S. and the Saudi Arabian intelligence agencies, volunteered for an al-Qaeda suicide mission. ...

Best of NSW crowned at sold-out event
Best of NSW crowned at sold-out event The Adviser Raymond Li of Alliance Mortgage Solutions picked up the Best Newcomer award, while the Rising ...

World Drone Prix promotes Dubai event by racing a McLaren
Filed under: Videos , McLaren , Middle East , Gadgets , Technology , Performance , Racing A Dubai Police McLaren 650S faces off against a racing ...

Log PC activity in real time with Event Monitor Service
Security vendor NoVirusThanks has released Event Monitor Service (EMSvc), a Windows application which logs key system events in real time. The ...

Tesla sends out invites for its game-changing Model 3 event
Tesla has already begun sending out invitations to its March 31 event where the company will, at long last, take the wraps off of its highly ...

Pitt Students ‘In Tears’ and Feeling ‘Unsafe’ After Milo Yiannopoulos Event
The University of Pittsburgh’s Student Government Board held a meeting on Tuesday to discuss the traumatizing visit the night before from Milo ...

Better Event: Twins Spring Training Or Ryder Cup?
CBS Local Better Event: Twins Spring Training Or Ryder Cup? CBS Local ... will feature the best Americans against the best Europeans. The ...

China opens ceremonial congress, key annual political event
BEIJING (AP) — China is kicking off its rubberstamp parliament session, the main event on its political calendar, on Saturday. The gathering ...

VP Joe Biden Mocks Donald Trump At Black History Month Event On Super Tuesday
"I want to thank Donald Trump ," Vice-President Joe Biden sarcastically today told a laughing D.C. gathering celebrating Black History Month ...

Marvel Games launches Women of Power event - EW.com
Who runs the world? Girls, according to Beyoncé … and Marvel. While Marvel’s dedication to bringing female superheroes to the front is not a ...

Resources last updated: 3/5/2016 9:37:52 AM