Using a 3D matrix with a matlab script block

Hi all of you,
it is possible to input a 3D matrix (e.g. 10x4x20) to a matlab script block or you have to unfold this data in a 2D array?
Do you know what i have to do to input directly a 3D array (array of real numbers) to a matlab script block.
P.D.; I'm using labview 7.0 and matlab 6.5
Thank you very much
Larson

Hi,
as far as I know there is only the possibility to have an input for a
2D array to matlab scriptnode. Thus you should convert your 3D data to
2D in LV and reconvert it in your matlab code into 3D.
When you select 3D data as an output of a script node it automatically
appears as 2D (but no data will be lost). So when you have to use it in
LV again as 3D data, what you have to do is reconvert it back from 2D
to 3D.
Hope this helps!

Similar Messages

  • Open a file using matlab script block

    Hello!
    I want to open a file from a specified directory using matlab script block.
    The input of this block is a string with file's name......but it doesn't work in this way. I have to change the input data or I have to change it  into matlab matlab script?
    Some idea?
    Thanks!
    Attachments:
    example.PNG ‏4 KB

    Ooooppss!
    My computer is crazy....sorry.
    I'm near to solve my problem...
    The problem is that I have a column of strings like this
    str=['labview'
            'labview2'
           'labview3'
            'labview4']
    I use the double command but the byte array to string block only converts me an element, do you know is exist another block to change all the elements.
    I've tried to do with a for loop block....using an index array and changing with i the index element, but it doen'st work.
    You have some idea?

  • Using matlab script block

    Hello!
    I'm using a matlab script block and I have a problem that i don't how to solve it,
    I want to import a column that in matlab is cell array or char array type. When you create an output in matlab script block you have to specify the data type....I choose string, but with this option you can only import one string....and I want to import a whole column.
    Someone knows how I have to do to import this data type? I have to do some changes to the data from matlab or I have to use some especific block in labview to adapt the data.
    Please help me!!
     Thanks!!!

    Ooooppss!
    My computer is crazy....sorry.
    I'm near to solve my problem...
    The problem is that I have a column of strings like this
    str=['labview'
            'labview2'
           'labview3'
            'labview4']
    I use the double command but the byte array to string block only converts me an element, do you know is exist another block to change all the elements.
    I've tried to do with a for loop block....using an index array and changing with i the index element, but it doen'st work.
    You have some idea?

  • Sending time and voltage samples as input to matlab script block

    Hello,
    I am planning to use Matlab script in labview and the matlab scritp block needs inputs of time and voltage values of sampled signal to post process.
    Can someone explain me of how to send the sampled values of time and volatge after every  'x' interval of time to the matlab scritp block I mean if the sampling rate is 100Hz then 100samples will be collected in 1 sec but I want to send both time and votlage values collected after every 10 seconds to the matlab scritp block.
    Thanks.

    Hi,
    I am using DAQUnit 6016 that samples an analog signal of sensor.The vi I tried is attached below.
    Attachments:
    Labview&Matlab.vi ‏55 KB

  • Undefined is not an object error when using the Output Generator with Glossary Restyling script to create WebHelp

    When I use the Glossary Hotspot Wizard to create links within my topics to the terms, I then generate the project using the script (because I want to use popups instead of having the text display in-line). I did not edit this script before running it - do I need to? If so, where does the script reside? Any suggestions would be appreciated so that I can get this working as intended :-).

    The error occurs during the WebHelp generation. If I generate the project
    without using this script, there is no error.
    The error indicates
    Line no: 395
    Thanks!
    Julie
    Julie Haddon-Cook
    Senior Specialist
    Messaging Engineering   
    Direct:      +1 770 303 3507
    CVS:         224 3507
    Address:   SITA | 3100 Cumberland Blvd | Atlanta, GA 30338 | USA
    Website:   www.sita.aero

  • Using matlab script

    Hello!
    I'm using matlab script block in my aplication. The m-file (from matlab) contain an 'if' that depends of an input of labview.
    I want to pass trough this condition only once when input's value changes, but labview "covert" this 'if' in a 'while' and pass trough this sequence n times.
    How can I to impose to pass throug the sequence once the input's value change. It's better to specifie it from matab or from labview.
    Thank you in adavance 

    What is surrounding the matlab script block? LabVIEW should be modifying the matlab code, it should be connecting with matlab and matlab executes its code, returning the results to LabVIEW. Can you do a screen capture of the part of the code that contains the matlab stuff? If yes make sure that it is saved as a .jpg (not .bmp!) for size reasons. If not, if you can send the part of your code that includes the matlab stuff that would help.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Compiling VIs with Matlab scripts

    Hi everyone,
    I need to build application for a VI with some matlab scripts included in the block diagrams using the Matlab scripts node. I've been searching for related topics and I'm hoping someone can help me understanding the big picture here.
    Background info: I'm using LV2012, Matlab 2013. I DON'T USE MathScript RT Module.
    Question:
    1. To build a stand-alone application for the use on a PC with Matlab software but no LabVIEW, do I just simply build the application in LabVIEW project?
    2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
    Thanks for answering my questions!

    Question:
    1. To build a stand-alone application for the use on a PC with Matlab software but no LabVIEW, do I just simply build the application in LabVIEW project?
    Yes,  Assuming it is a windows machine and the Licensed version of Matlab is version 6.5 or later the LabVIEW Run-Time engine knows how to call the Matlab script server through Active X.
    2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
    You cannot use a Matlab math script node without a licensed version of Matlab 6.5 or later resident on the target and the target must support Active X so, Windows only.
    Jeff

  • Intermittent issues with Matlab Script in LV2012

    I'm having some intermittent issues with the Matlab Script in LV2012.  I'm running Windows 7 64 bit, and my Matlab is 2013 64-bit.  I've tried the suggestion here:
    http://digital.ni.com/public.nsf/allkb/8BEBC0C86541224286257AF300561B5E
    I tried this but it didn't work for me. 
    I've also looked at this:
    http://digital.ni.com/public.nsf/allkb/2B3FF46C8512C4F786256CF30071BE53?OpenDocument
    In one of my .vi's if I change 2 of the 3 input variables to the complex type, it works.  It seems to be insensitive to the data type of the first input variable.  In another .vi this trick doesn't work at all.  The fix given in the link is to update the .dll, but this seems to be old news as the .dll in my directory is newer than the one referenced in this link.
    The other funny thing is these scripts worked fine on Friday afternoon, but were throwing this error this morning.  I've closed and reloaded both Labview and Matlab, but that didn't fix the issue.
    Are there any new fixes for this issue that I haven't been able to find?
    Thanks,
    Doug

    Doug,
    If you have a service contract feel free to call in to the support line and you'll be able to work with someone on the phone. That'll be the quickest way to resolution.
    Feel free to send me a PM if you wish and I can take a look at the code and test it on our machine. 
    Notes for Branch AE:
    Please reply to This Post within 24 hours
    The US AE is expected to reply to all of your posts within 24 hours. Having this expectation will keep the escalation moving quickly and toward a fast resolution.
    You can also use other communication channels: Phone, Sametime, Lync,etc. to discuss the issue with the US AE. This can help with troubleshooting and quick diagnosis of the issue.
    Click here to provide kudos for a post on this page

  • Using Matlab script in Labview

    Hello,
    I am trying to use matlab script in labview to post process the sampled signals from DAQ(attached is the vi I tried)
    After every 10 seconds I want to the send the sampled voltage data to matlab scritp block which does 1) detection of peaks using peakdetection function and plots the obtained peaks on the sampled signal 2) calculates standard of 10 secs data and plots on chart.
    But I am confused of 1) how to call the peakdetection function inside the matlabscript block
    2) How to send the 10secs data of voltage and time values to the matlab script block
    3) How to plot the signal and detected peaks on the same plot (which can be done in matlab using holdon as shown in the atached vi).
    Can someone suggest for implementing these .
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Labview&Matlab.vi ‏55 KB

    Thanks  GabeG,
    Now, Labview&Matlab_TestNoAq.vi  is woking Good and for the second one  Labview&Matlab_TestAq.vi it is showing error as shown in the attached image when these ines of code are present in the matlab scrtip 
    subplot(2,1,1),plot(maxtab(:,1),maxtab(:,2),'*r');
    SDN=std(maxtab(:,1));
    and SDN output of the Matlab script
    but when I removed these it is working fine(but not showing the detected peaks).
    Can you suggest me a solution for the above and also can I know the best method to add one more channel that samples another device signal which has to be processed in this same way(Signals sampled from 2 devices have to be porcessed in this same way).
    Thanks.
    Attachments:
    Script_Error.JPG ‏133 KB

  • Matlab script image support?

    Hi there,
    I'm trying to use the imread function in the matlab script node to translate an 8-bit image into a intensity-value matrix. It works in normal matlab, but not in the node. I can't find the imread function in any of the labview help menus, so I was wondering if labview supports that function at all. If not, does anyone have any suggestions for automating getting the image into matrix form? Thank you,
    Stephanie

    Hello Stephanie,
    Are you using the same script in the node as you use in the MATLAB® software?  What is the error returned by the node?  Are you running the VI on the same machine where you tested the script in the MATLAB software?  The imread function does seem to be part of the Image Processing Toolbox, so you will need to ensure that this toolbox is installed on any machine that you intend to use to run your VI.
    The LabVIEW MathScript node is a textual node and its syntax is generally compatible with the m-script syntax used by other technical computing software.  Jeff is correct in that LabVIEW MathScript does not currently support the imread function.  However, it will likely be added in a future version of LabVIEW.  If you are looking for a solution in graphical code, LabVIEW does provide some VIs for reading and writing PNG, JPEG, and BMP files.  You can find the VIs in the Programming >> Graphics & Sound >> Graphics Formats palette.  You can then use the Unflatten Pixmap VI to get a matrix representation of your image.
    National Instruments also produces a Vision Development Module for LabVIEW that includes more advanced image acquisition (IMAQ) and image processing functionality.  This module is more for industrial and scientific use than for duplicating what might be provided in desktop image manipulation programs.
    MATLAB® is a registered trademark of The MathWorks, Inc.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • I cannot run the matlab script node in the labview

    Hi there,
    My LabVIEW version is 8.5, and matlab version is R2008a.
    I wrote a simple matlab code, like x= 1, y = x*2. Then I tried to put them into matlab script node in LabVIEW.
    However, when I ran the program, I couldn't run and Labiew show some error. 
    Then I tried the method talked before on this forum. Please see the following link.
    http://forums.ni.com/ni/board/message?board.id=MathScript&thread.id=571
    I followed the instruction and open the "command prompt," type some commands then I could run the program, and simultaneously, the LabVIEW program open "Matlab command line window" and run my labview code. However, if I didn't use the command prompt, the  "matlab command window" will not be opened by running the labview program. It would just show some error. And even if I turn on the matlab program in advance, I still couldn't run the labview program.
    Is there any effecient way to deal with this problem without using "command prompt?" Because I try another PC with both matlab and labview installed on it, I "can" run my simple matlab script node on it, and it will open the matlab command line window automatically by running my code. Therefore, I thought there might be some software linking problems in the previous PC I used . Do you have any ideas?
    Thanks in advacne.  

    Hi, and thanks for the post! I hope your well today.
    This may help,
    MATLAB® version 2006b (7.3) and version 2008a do work with LabVIEW
    8.20. This problem can occur if a new version of the MATLAB® software
    is installed along with a previous installation, which is then
    uninstalled. The uninstallation of the older MATLAB® software results
    in removing the ActiveX/COM components LabVIEW uses. This can cause the
    MATLAB® script node in LabVIEW to stop working. There are three
    solutions to this problem.
    Uninstall the MATLAB® software and reinstall it. This should install the necessary ActiveX component.
    Restore the MATLAB® automation server. Browse to the \bin directory (e.g. MATLAB\R2006b\bin) and type matlab -regserver ,
    which will reset the registry settings and start the server. The server
    can then be closed and the MATLAB® script node will work properly again
    in LabVIEW. LabVIEW may need to be restarted if VIs are open that
    contain MATLAB® script nodes.
    Leave both versions of the MATLAB® software installed.
    MATLAB® is a registered trademark of The MathWorks, Inc. Other
    product and company names listed are trademarks and trade names of
    their respective companies.
    Did you have an older version of MATLAB before 2008a?
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Matlab script in executable won't run

    I'm having trouble with getting a VI with a MATLAB script to run reliably, specifically when built into an executable.
    I'm using LV8.0, Matlab R2006a.
    The VI (not executable) runs properly when I start the computer fresh (i.e. just after a reboot)
    The MATLAB command window opens as soon as I open the VI.
    If I build an executable and run it, it works, so long as I haven't closed LabVIEW and the VI.
    If instead, I attempt to close out LabVIEW and run the executable alone, the MATLAB command window does not start, and the MATLAB functionality is ignored.
    I have updated all of my dlls, and I have checked the box enabling the ActiveX server (though I don't know what to name the server).  I have also read all the associated Knowledge Bases, and found their solutions did not apply.
    I also have intermittent issues running the VI once I have tried running the executable.
    If I make a change to my MATLAB script, I can get the VI to run again, but if it has failed once, the MATLAB command window no longer opens when the VI is opened.
    I can solve this problem by rebooting too, but it seems like there should be a better way.
    Any ideas?

    Hi tblir,
    Can you try to run and build into an
    executable one of the shipping examples (i.e.  MATLAB Script – Fractal.vi)?  Let me know if this exemplifies the same behavior.
    Ecleamus Ricks, Jr.
    National Instruments
    Applications Engineer

  • Differential input to SCXI 1120 with a 1305 input block - noise

    Hello,
    I'm trying to measure low amplitude, DC voltage signals using an SCXI 1120 with the 1305 terminal block. I'm picking up ground noise and I'm having a hard time finding my way through the manuals to solve my issue.
    Currently I'm tieing the negative output of my load cell to the ground, as shown in the attached diagram. This is similar to Table 1, row 1, column 1 of the NI wiring document (http://zone.ni.com/devzone/cda/tut/p/id/3344).
    Reading the 1120 user manual (http://digital.ni.com/manuals.nsf/websearch/7D3481BCFAA9E300862567EF0071F865), there are two setups for DC inputs in Figs 3-2 and 3-3. My current setup is similar to 3-2, but I have a CMV of zero, so this setup is not required. It seems that the setup in Fig 3-3 would be better for me, but I can't seem to use that configuration with the 1305 terminal block.
    Fig 3 of the 1305 user manual (http://digital.ni.com/manuals.nsf/websearch/B02C64965878A95186257449005FBFAC) shows that you can link the negative to ground through a bias resistor, but specifies that for the 1120 this is to be left floating. In fact, in the text above Table 1 of the manual it specifies in italics that this be left in position G.
    Is it possible to have the setup shown in Figure 3-3 of the 1120 manual using the 1305 terminal block? Should the setup that I have be okay? When I tie the load cell chassis to ground I get a noise signal that is periodic at 60 Hz (I'm in Canada), but has spikes and plateaus in it, but at low amplitue. If I remove the ground connection I get a relatively clean 60 Hz, sinusoidal noise component with an amplitude of ~0.5mV. My signal is at about 10mV, so this is significant for me.  Using the second configuration I could digitally notch filter at 60 Hz, but I'd rather not.
    Thanks for your help.
    Attachments:
    circuit.jpg ‏46 KB

    Hello, Gorgeman!
    I think you'll find this document useful: Referencing a Floating Input to Ground Using the SCXI-1305
    Please let us know if you have any questions!
    Will Hilzinger | Switch Product Support Engineer | National Instruments

  • State control from script block

    Hello, my Flex SWF is receiving a local connection from
    another embedded SWF.
    When this local connection is made and the relevant function
    is called by the sender SWF, what is the best way to initiate a
    state change within the parent receiver SWF ?
    i,e. how do I initiate a Flex state change from withing a
    CDATA script block ?
    Thanks for any help.

    That can work. I assume you've already seen:
    http://learn.adobe.com/wiki/display/Flex/Local+Connections
    the AS would simply be something like:
    currentState = 'myNewState';

  • Creating a random noise (Gaussian) using Matlab Script

    Hello,
    Since I only have Labview 6.1 base, I can't use the white-noise generator in Labview. I'm thinking of using the Matlab Script. I have Matlab 2006R installed in the same computer. However, I tried running the program and nothing happened (I used the help example "a=rand(50);surf(a)" in the Matlab Script.
    Why it's not calling the Matlab, or is there a better way to create a Gaussian distribution in Labview 6.1 Base?
    Thanks a lot!

    Hello,
    Why are you unable to use the Gaussian White Noise VI in LabVIEW 6.1?  It is under the Analyze >> Signal Processing >> Signal Generation palette.  I have attached a simple VI that illustrates creating a matrix.
    If you wish to use the MATLAB® script node, let's first make sure it is working correctly.  Try opening one of the LabVIEW shipping examples.  Browse to <LabVIEW>\examples\scriptnode and open "HiQMATLAB_Fractal.llb."  Then open "MATLAB Fractal.vi."  Run the VI.  Do you get any error windows that pop up?  If not and you see a picture of a fractal appear, then the connection to the MATLAB software is working correctly.  In your VI, try creating an error out indicator from the MATLAB script node and see if any errors appear.
    If you do see an error in the shipping example, it means there is a problem with the software connection.  Make sure that you have launched the MATLAB software at least once after you installed it.  This will set up the necessary connection information.  Then launch LabVIEW.  If this isn't the issue, we could try manually restoring the server commands.  Make sure LabVIEW and the MATLAB software are not running.  Go to a command prompt, browse to the MATLAB bin directory (e.g. MATLAB\R2006b\bin), and type
    matlab -regserver
    Quit the instance of the MATLAB software that appears and launch LabVIEW.  If this also fails, please post again with any error information you receive.
    Also, the rand function in your script will not generate a Gaussian distribution. You will need to use the randn function instead.
    MATLAB® is a registered trademark of The MathWorks, Inc.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
    Edit: For some reason, I am unable to attach the VI.  I have included a picture instead.
    Message Edited by GrantM on 08-08-2008 02:50 PM
    Attachments:
    Gaussian Matrix.png ‏35 KB

Maybe you are looking for

  • Question about backing up to an external hard drive and then restoring

    I want to back up my iPhone to an external hard drive rather than to CDs/DVDs, and it isn't an option under "Backup." I thought this could be done by consolidating the iTunes library and then copying the entire iTunes folder to the hard drive. But no

  • Downloading adobe

    How do you download adobe flash player on the MAC? I cannot play You Tube videos without it...

  • How do I get iPad 2 to recognize a Kodak HERO 5.1printer?

    How do I get iPad 2 to recognize a Kodak HERO 5.1printer?

  • Control Surfaces and Native Plugins

    I have a Novation RemoteZero SL and, though I can access basic volume and pan, and I can control plugins from other companies where Novation has set up "AutoMap", I can't control Logic's own plugins! It won't learn them or control them in any way. Th

  • Split Idoc

    hi,   Please let me  know ,How  to  Split larger  Idoc  into  Multiple  Idocs? Thanks, Asha