f

#### 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.
%
% 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(r*sin(gamma-sb)/temp))*(1 + (r^2 - R^2)/
(2*R*temp)) ...
+ sb) - x3;

% find_PI_Line.m
%
% Find the the parametric interval corresponding to the unique PI-line
% passing through the point x for a given helical pitch.
% This code implements the method of Kyle Champley.
% inputs: P = pitch (cm/turn), R = helix radius, delta_s = s stepsize,
x
% output: PI = [sb st]
%
% last update: 5/18/06

function [PI] = findPI(P,R,delta_s,x)

h = P/(2*pi);
r = sqrt(x(1)^2+x(2)^2);
gamma = atan2(x(2),x(1));

options = optimset('TolX',h*delta_s/100,'FunValCheck','on');

[sb,fval,exitflag] = fzero(@(sb)  PIfun(r,R,h,gamma,x(3),sb),...
[(x(3)-h*pi)/h,x(3)/h],options);

if exitflag ~=1,
disp('Error: PI invalid');
end

% note that beta=sb in Kyle's formula
alphaX = atan(r*sin(gamma-sb)/(R - r*cos(gamma-sb)));
st = sb + pi - 2*alphaX;
PI = [sb st];

```
 0
sokitty (4)
6/21/2007 2:16:36 AM
comp.soft-sys.matlab 211266 articles. 15 followers. lunamoonmoon (258) is leader.

5 Replies
958 Views

Similar Articles

[PageSpeed] 41

```Where exactly are you having a problem? Is there a compilation error?
At which line? I am assuming you tested it in Matlab 7, and it works
fine?

```
 0
skt (274)
6/21/2007 3:50:43 AM
```On 6 21 ,   11 50 , Srikanth <s...@xdtech.com> wrote:
> Where exactly are you having a problem? Is there a compilation error?
> At which line? I am assuming you tested it in Matlab 7, and it works
> fine?

You konw I want it to work in Matlab 6.5 not Matlab7 but it doesn't
I have called this function :
PI(i,j,k,:) = findPI(P,R,delta_s,[x(i) y(j) z(k)]);
I get this
??? Error: File: C:\MATLAB6p5\work\fbp\findPI.m Line: 20 Column: 29
"identifier" expected, "(" found.

Error in ==> C:\MATLAB6p5\work\fbp\flat_plain.m
On line 362  ==>              PI(i,j,k,:) = findPI(P,R,delta_s,[x(i)
y(j) z(k)]);

```
 0
sokitty (4)
6/21/2007 4:45:15 AM
```Hi
Are you sure this worked under Matlab 7? Because this kind of error is
often something wrong in your code, not something because of a change
in matlab... In the line 362, there is a problem at function call. Try
making a test program, and pass values instead of variables, to see if
your function works. If it does, there is something wrong in the way
you are calling it. If you still get an error, check your function...

```
 0
skt (274)
6/21/2007 6:11:31 AM
```<sokitty@sina.com> wrote in message
>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

*snip*

> [sb,fval,exitflag] = fzero(@(sb)  PIfun(r,R,h,gamma,x(3),sb),...
>                        [(x(3)-h*pi)/h,x(3)/h],options);

Anonymous functions, as this code uses, were introduced in MATLAB 7.0 (R14).
They were not available in MATLAB 6.5 (R13), so you cannot use them in that
version of MATLAB.  You will need to rewrite this code to use a regular
function handle or an inline function with the P1, P2 syntax given in HELP
FZERO.  This document will also help you modify the code:

http://www.mathworks.com/support/solutions/data/1-19HM6.html?solution=1-19HM6

The first half of the Solution section deals with MATLAB 7.0 (R14) and
later; the second half deals with versions of MATLAB prior to 7.0.

I very briefly scanned the code, but I didn't see anything else that looked
like it obviously wouldn't work in MATLAB 6.5.  That doesn't mean there
aren't any, though.

--
Steve Lord
slord@mathworks.com

```
 0
slord (13687)
6/21/2007 2:04:39 PM
```On 6 21 ,   10 04 , "Steven Lord" <s...@mathworks.com> wrote:
> <soki...@sina.com> wrote in message
>
>
> >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
>
> *snip*
>
> > [sb,fval,exitflag] = fzero(@(sb)  PIfun(r,R,h,gamma,x(3),sb),...
> >                        [(x(3)-h*pi)/h,x(3)/h],options);
>
> Anonymous functions, as this code uses, were introduced in MATLAB 7.0 (R14).
> They were not available in MATLAB 6.5 (R13), so you cannot use them in that
> version of MATLAB.  You will need to rewrite this code to use a regular
> function handle or an inline function with the P1, P2 syntax given in HELP
> FZERO.  This document will also help you modify the code:
>
> http://www.mathworks.com/support/solutions/data/1-19HM6.html?solution...
>
> The first half of the Solution section deals with MATLAB 7.0 (R14) and
> later; the second half deals with versions of MATLAB prior to 7.0.
>
> I very briefly scanned the code, but I didn't see anything else that looked
> like it obviously wouldn't work in MATLAB 6.5.  That doesn't mean there
> aren't any, though.
>
> --
> Steve Lord
> s...@mathworks.com

Hi
Thank you very much .
I will have a try .

```
 0
sokitty (4)
6/22/2007 1:37:07 AM

Similar Artilces:

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...

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 ...

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...

Problem using Matlab 6.5 codes in Matlab 2007b
I have written some code in Matlab 6.5 and they are running perfectly in that version. But if I try to run the same using Matlab 2007b, I am facing problem. It starts giving error like dimensional mismatch and etc. Why the program written in lower version is not running in higher version? "Dwaipayan Dasgupta" <ddg.abhhih@rediffmail.com> wrote in message <gvto39\$jsf\$1@fred.mathworks.com>... > I have written some code in Matlab 6.5 and they are running perfectly in that version. But if I try to run the same using Matlab 2007b, I am facing problem. It starts giving error...

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;...

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 ...

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 ...

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...

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...

How to use MATLAB 4.0/5.0 programs in MATLAB 7.0 environment.
hi, I will be very grateful if somebody tell me how to run MATLAB 4.0/5.0 programs in MATLAB 7.0.4. I was trying to run but it shows error. Thank you. With Regards, Binod Prasad Koirala And the error says .... KWs`ef}c}n,m_}___im}r}mrfmcs%arkg}cn>f}mljglmjtk`cwa__}C_%8 "Matt Fig" <spamanon@yahoo.com> wrote in message <gmkhie\$p1k\$1@fred.mathworks.com>... > And the error says .... > > > > > KWs`ef}c}n,m_}___im}r}mrfmcs%arkg}cn>f}mljglmjtk`cwa__}C_%8 The error says.... At compilation, "ybus" was determined to be a variable an...

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/> ...

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 ...

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 ...

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 ...

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 ...

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...

issues involved in moving from MATLAB 5.3 (Release 11.0) to MATLAB 6.0.
Hi, I,ve found the reason for a problem I had (and posted last week), passing from M 5.3 to 6. In "Programming and Data Types Issues" I found that: "Attempting to assign a structure to a field of another structure now results in an error if both of the following conditions are true: The field being assigned to has been initialized to an empty matrix. The field being assigned to is referenced in the assignment using an array index. For example, mystruct.emptyfield = []; mystruct.emptyfield(1) = struct('f1', 25); ??? Conversion to double from struct is not possible. Th...

Different Matlab versions (6.5 and 7.0) problem
Hi all, I would be glad if you could help me with this "problem" that I have. I am working on two computers with different Matlab versions (Matlab 6.5 at home and Matlab 7.0 in my office). When I transfer files (.mat or whole workspaces) and figures (.fig) from the computer with version 6.5 to 7.0 it is no problem, but the opposite direction doesn't work (error message: unable to read file). Have you got some idea how to solve this? I can't update my computer at home to verision 7.0.... Best regards Pat "KingKong" <v.97@spray.se> wrote in message news:...

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? ...

Fminsearch works differently in MATLAB 6.5 and 7.0.x
Hi! I've get a program that heavily uses the fminsearch function. The person who developed the code is working with Matlab 6.5. I have 7.0.4. The problem is that after running the exactly the same program with same parameters on both version, the results are sightly different, but big enough in our case to give a wrong result. What is the difference between the two version? How can have the same functioning as we would like to distribute the code to people who use Matlab 6.x and 7.x, and it is not good if we have such numerical differences. Thanks, Zoltan I checked all the release note...

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 > ...

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. ...

matlab extern: mxGetPr replacement in MATLAB 6.5.0.180913a ??
Hi All, I am writing this matlab application and for the application. So in my C++ program, I am trying to interface with the MATLAB engine for the same. I have a case wherein I need to get the elements of mxArray, containing elements of type 'double'. mxArray * INSIDE ; .. INSIDE = engEvalString("INSIDE = X + Y;"); double *inside = mxGetPr(INSIDE); for (int i = 0; i < maxInside; i++ ) { fprintf(stdout, "%ld ", *(inside + i)); } The program crashes on trying to access the elements of the array ...

Web resources about - some problems of codes of MATLAB 7.0 working on MATLAB 6.5 - comp.soft-sys.matlab

Problem novel - Wikipedia, the free encyclopedia
Working class, or proletarian novels are often also social problem novels . This was in many ways a reaction to rapid industrialization , and ...

The McLaren 570GT solves one of the biggest problems with supercars
VIDEO: McLaren's new supercar is optimised for long road trips.

Pope Francis' cardinal problem: an exit strategy for George Pell
After four days of forensic cross-examination by the royal commission, where he repeatedly pleaded ignorance about clerical sexual abuse, the ...

Whiskey Tango Foxtrot and Hollywood's latest problem with whitewashing
The movie industry's structural racism appears to be as intractable as ever, with a new film accused of whitewashing.

The problem with House of Cards: nothing goes according to plan in the real world
The popular political drama is full of conniving and evil plans, but remember: it's a work of fiction.

The problem of relabeling Trump as "Drumpf."
Many of those who seek to diminish Donald Trump have jumped at the idea of tagging him with the name Drumpf, which was the surname of his ancestors ...

Patrick Murphy's Money Problems
Al Franken hasn't been a bad Senator... unless you were expecting a real fire-breathing progressive champion like Elizabeth Warren or Jeff Merkley. ...

Rubio: Anger, Fear Can Serve to Motivate Us But Will Not Solve Our Problems
Rubio: Anger, Fear Can Serve to Motivate Us But Will Not Solve Our Problems

Xerox CEO Ursula Burns explains the problem with a corporate culture that's too nice
When Xerox's executive team met in 2014 to discuss the proposed sale of its information technology outsourcing (ITO) business to the French company ...

No Lundqvist, no problem: Raanta, Rangers beat Capitals
WASHINGTON (AP) — Antti Raanta made 32 saves while subbing for the injured Henrik Lundqvist and Derek Stepan scored as the New York Rangers bounced ...

Resources last updated: 3/7/2016 9:16:53 AM