LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

moving image

Hello,

I am new to LabView and I am running into serious difficulties
transitioningfrom Matlab. I am primarily going to be using LabView for image
processing and simple tasks in Matlab seem to be very difficult (my lack of
experience) in LabView. As an example, here is a simple mathscript that generates a
moving image:

================================
k = 0:199;
numFrames = 15;
m = moviein(numFrames);
for frame = 1:numFrames
x = sin(k*2*pi/200 + pi/2 + (frame - 1)*2*pi/numFrames) + 1;
b = repmat(x’, 1, 200) * 128;
image(b), axis image
m(:,frame) = getframe;
end
movie(m)
================================
I have tried to replicate the same script in LabView, but I do not seem to
succeed due to the fact that I am unable to replicate the moviein and movie
functions in LabView. Would you be kind to guide me through the process?

Thank you,

Ermenegildo
0 Kudos
Message 1 of 19
(3,744 Views)
Are you trying to use the MathScript node or the Matlab node? The MathScript node uses NI's version of a Matlab-like language, and I don't see "movie"-related functions supported. The Matlab node can be used and you can enter Matlab code directly in it.

For example, using a Matlab node, the following script (taken from the Matlab help) works to generate a pretty animation:
Z = peaks; surf(Z)
axis tight
set(gca,'nextplot','replacechildren');
for j = 1:20
    surf(sin(2*pi*j/20)*Z,Z)
    F(j) = getframe;
end
movie(F,20) % Play the movie twenty times



0 Kudos
Message 2 of 19
(3,719 Views)
Hi,

I've tried to use th mathlab node and mathscript node and still not able to recreate the same process as in Matlab.

Thank you
0 Kudos
Message 3 of 19
(3,696 Views)
I tried to run your Matlab script in Matlab (6.5), but then I realized that there's a garbage character in the code you posted:
b = repmat(x’, 1, 200) * 128;
What is that first parameter supposed to be?
0 Kudos
Message 4 of 19
(3,691 Views)
Hello,

b = repmat(x’, 1, 200) * 128;

is

b = repmat(transpose(x),1,200)*128;

thank you

0 Kudos
Message 5 of 19
(3,681 Views)
Well, I entered the script into a Matlab node and ran it and it worked. What I saw were horizontal bands of different colors moving horizontally up. Attached is the VI I created. I used LabVIEW 8.2 and Matlab 6.5. What happens when you run it?
0 Kudos
Message 6 of 19
(3,668 Views)
Hello,

I am not able to run the script in my machine Do I need additional modules? I tried to run the enclosed file and it did not work.... I get the following error :LabVIEW:  Error occurred while executing script. Error message from server: . in Matlab Movie Test 2.vi:

thanks you
0 Kudos
Message 7 of 19
(3,643 Views)
I don't believe any special modules are needed. There should have been an error code with the error message. What version of Matlab do you have installed on your computer? Does the script work inside of Matlab? Try running one of the Matlab examples that ships with LabVIEW. Go to Help->Find Examples, change to the Search tab and enter "matlab". You'll find two Matlab examples. If those don't work, there's a problem in the interface between Matlab and LabVIEW.

Here are some pages in NI support regarding Matlab and LabVIEW errors:
http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddown=0&filter=%2Btaxonomy:top+%2B(met...

You can get these results by entering "matlab labview error" in the search box at the top of the page and selecting "Entire Site".

Message Edited by smercurio_fc on 10-17-2007 01:13 PM

0 Kudos
Message 8 of 19
(3,639 Views)
Hello,

I've tried to run the built in examples and i get the same error and followed the instructions from the help links... dunno waht to do...
uh


thanks
0 Kudos
Message 9 of 19
(3,628 Views)
You still haven't told us what the error you're getting is.  I get error 1050 because I don't have Matlab installed on the PC.
0 Kudos
Message 10 of 19
(3,622 Views)