Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

09-05-2007 03:29 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

09-06-2007 11:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Is it only slightly different or complely wrong?

Error handling in a matlab script node is not very good. Have you at least hooked up the error output of the matlab script frame? Does it tell you anything?

09-06-2007 12:56 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Along with Altenbach's statement, can you provide me a simplified version of the .m script code you used that will reproduce this error? If we know what is expected and what is actually outputting we can determine internally what the problem is and how to fix it.

Also, have you tried the MathScript node in place of the Matlab script node?

Cheers.

09-06-2007 12:57 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Jarrod S.

National Instruments

National Instruments

09-08-2007 01:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

There are some functions that I am using as seperate .m files and also .dat matrices. Since, definition of functions are not allowed in the script. I copied all files to the matlab\work folder. The code is working after the files were copied but giving a different result. Result is not meaningless but like some part of a function is dealt differently or missing, which changes all result. Is there another way to define functions in or to do matlab script. These functions are as the following:

function y=difsphbesselj(n,x)

y=(-1/2)*(sqrt(pi/2))*(1/x)^(3/2)*besselj(n+1/2,x)+(1/2)*(sqrt(pi/2))*(sqrt(1/x))*(besselj((-1/2)+n,x)-besselj((3/2)+n,x));

12-23-2012 06:36 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

12-23-2012 07:31 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

... you just added to a 5 year old thread. When you say "same code", do you mean the same code as in the 5 year old thread above or some completely unrelated code which is the same in matlab and matlab script.

What is your LabVIEW version? What is your matlab version? How often is "sometimes"?

Can you attach an example that shows the problem? DId you try some of the suggestions mentioned above?

12-23-2012 08:21 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Labview 8.5

Matlab R2009b

Attached are the graphs produced by matlab script in labview and in matlab.

The minimum of graph produced by matlab code is below 1 and that in labview is above 1.

Thanks a lot for your reply.

Sorry, I haven't quantified the "sometimes" yet.

Download All

Virus scan in progress. Please wait to download attachments.

12-23-2012 11:33 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

It looks to me like you have the same picture, except that the results seem to be mirrored about the line Y=X. (the 45deg line).

You should check your code again and make sure it truly matches and you didn't flip your indices.

12-23-2012 11:52 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I agree, the 2D array seems transposed, while the axis assignment (offset,increment) are not transposed. You did not show any code, but that graph is formed most lkely ouside the matlab node. We need to see some code.