My problem with matlab script node is related to calling function in matlab. I created an m-file function that takes an imput temperature (from DAQ) and defines a material property. My matlab script node doesn't seem to recognize my function. I have placed the function in the folder the vi is currently located, but it doesn't read it. How do I get matlab script node to read the functions I create in matlab? Add the directory to matlab path, or call the .m file with it full name ( D:\..... \myfile.m) Let me clarify, I have pasted my matlab code into the matlab scrip node. In this code, I have called a subfunction that I have created. Example k(n)=k_c(T(n)) where k_c is a subfunction I have created. How do I get my code in the node to sucessfully read the subfunction k_c? As indicated, you need to add the directory where the .m file containing the function resides to the list of paths that are read in. This is your startup.m file. The other option is to do a "cd" command prior to calling your function to change to the directory where the .m file containing the function resides. Thanks for reiterating the information. My matlab script node is working properly. I had never used the "cd" command in matlab. I always set the working directory when I open the program, and put all the m files into t...

Hi, does anyone know why Fortran-mex files can't be compiled on matlab V5.3 and run on matlab V6? For example: if I compile the example-program (shipped with matlab) timestwo.f on matlab version 5.3 (R11) and try to run it on matlab version 6+ (R12 or R13), I get the error message: "Unable to load mex file: E:\timestwo.dll. The specified module could not be found. ??? Invalid MEX-file" Likewise if I compile it on matlab version 6.1 (R12), I get a similar error message if run on matlab version 5.3 (R11). However, if I run it on matlab version 6.5 it works OK. If I try the same experiment with the corresponding example file written in C, timestwo.c, I get no such problems. Why is that? Per A. Hi Per, usually MEX-files need to be compiled with the MATLAB version you want it later to run with. The reason is, that the code links against the current dynamic libraries (DLLs), which may change from version to version. You may have luck that it works (see your example of timestwo.f), but you should never rely on this. Titus "Per A. Brodtkorb" <Per.Brodtkorb@ffi.no> wrote in message news:eecb303.-1@webx.raydaftYaTP... > Hi, > > does anyone know why Fortran-mex files can't be compiled on matlab > V5.3 and run on matlab V6? > > For example: if I compile the example-program (shipped with matlab) > timestwo.f > on matlab version 5.3 (R11) and try to run > it on matlab version 6+ (R12 or R13), I ...

undefined ...

Dear all, i did not have this problem with previous Matlab releases. My problem is that since I have the 2011b release every time I run a m-file it hangs 5-6 seconds after all the computation are performed. In those 5-6 seconds I cannot do anything, neither checking workspace or write in the command window or using the editor. I tried to create minimal examples to understand when it does that and it looks that the problem is related with figures. The following code never hangs (I tried 10 times): close all clear all clc a= 1:1:100000; The following code always hangs: close all clear all clc a= 1:1:100000; figure and also the following code always hangs: close all clear all clc a= 1:1:100000; plot(a(1:1000)) This is very annoying. Expecially when you are "debugging" your code or trying different inputs. Any suggestion? thanks Alberto "Alberto " <canestrelli@idra.unipd.it> wrote in message news:jmkcg9$54$1@newscl01ah.mathworks.com... > Dear all, > i did not have this problem with previous Matlab releases. My problem is > that since I have the 2011b release every time I run a m-file it hangs > 5-6 seconds after all the computation are performed. In those 5-6 seconds > I cannot do anything, neither checking workspace or write in the command > window or using the editor. I tried to create minimal examples to > understand when it does that and it looks that the problem is related with &...

I have a Matlab m-file that reads in my data and successfully displays to the screen an animation of the data. Now, I’m attempting to generate an animation *output file*, so that I can replay this animation in a portable (e.g. .gif ) format on other non-Matlab PCs. At present, the code that I show below *does* generate an “animation” output file (of several MB in size, where one component frame is several kB). However, the problem seems to be that the output “animation” file just contains hundreds of the same frame (which is the final frame of the entire animation), rather than the correct, individual animation frames. I’ve attempted to follow the example code shown in this Matlab Solutions link: How can I create animated GIF images in Matlab? http://www.mathworks.com/support/solutions/en/data/1-48KECO/?solution=1-48KECO and here is a simplification of my code (I omitted much of my correctly-working animation code, and included the full new animation-file-generating code): ------------------------------------------------------- filename = 'myAnimation.gif'; for i=1:Endval % calculate and plot animation to screen % ... set(plot(x,y,'b',x,y,'bo', xtarget, ytarget, 'rx'),'LineWidth',3); drawnow; % new animation-file-generating code frame = getframe(1); im = frame2im(frame); [imind,cm] = rgb2ind(im,256); imwrite(imind,cm,filename,'gif','WriteMode&...

Hello, I have a signal in matlab .m format and I want to read it by using LabVIEW for further processing. In matlab_file_reader you can see my approach. As documentation I have used the document Mat-File format (you can download it from http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf) The signal is also attached bellow, I change the extention from.m to .txt to be able to attach the file As you can see in the Endian Indicator of the Header Flag Field has a value of "IM" which indicates that the signal should be read by inverting the bytes order. I perform that and I start to read the values. On the vi attached only the two first values are readed. The values that I obtain are: value 1 = 6 value 2 = 1 and they should be (when the signal is readed with matlab - load(signal) command): value 1 = 0.6736 value 2 = -0.0911 as you can see there is something wrong. The data type that I read from the Sub Element Tags are 32-Bit Unsigned and 32-Bit signed for the first two values respectively, something that can not be if you see the expected values. Does anyone know where the problem could be? matlab_file_reader2.vi: http://forums.ni.com/attachments/ni/170/283953/1/matlab_file_reader2.vi signal.txt: http://forums.ni.com/attachments/ni/170/283953/2/signal.txt Hi, I have been looking at this for a while now and yes you have missed out the array subset flags, array size, and array name registers. Once you process...

Hi! I opened the matlab script fractal.vi then my antivirus (Kaspersky) ask if I acept the modified te registry of matlab setup, I say "yes" After that when I want open matlab the setup run but inmediatly it's close, why???? Hola: Abri el matlab script fractal.vi y mi antivirus (Kasoersky)me preguntaba si aceptaba una modificacion del registro del setup de matlab yo acepte Despues de eso cuanto abro matlab se cierra inmediatamente porque?? Hola Sa�l Es probable que el problema est� relacionado con el antivirus Kaspersky, trata de deshabilitarlo y correr nuevamente el ejemplo. Si esto no funciona revisa el estado de tus licencias de LabVIEW y de Matlab, probablemente tengas que reinstalar el programa y/o activar las licencias. �Qu� versi�n de LabVIEW y Matlab tienes? �El comportamiento es el mismo con el otro ejemplo?, me refiero al de la siguiente dir: labview\examples\scriptnode\Differential Equation.llb\MATLAB Script - Lorenz Diff Eq.vi Si corres este ejemplo �El antivirus tambi�n te pregunta cambiar lo de los registros?, ser�a bueno contactar a Mathworks para saber c�mo reconfigurar nuevamente los registros de Matlab ...

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 incompatibility with previous versions of Matlab is the new encoding of MAT files. Matlab release 14 writes character and figure data to MAT-files using Unicode encoding by default. Unicode encoded MAT-files are not readable by earlier versions of Matlab. If you intend to load your MAT-files created with Matlab release 14, you must override the Unicode default during the save. You can override the default encoding by using the -v6 switch with save and hgsave: save filename -v6 hgsave filename -v6 Hope it helps Linda wrote: > > > 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 ma...

Hello, I would like to execute a Matlab m-file several times from LabView. I want to start Matlab only once at the beginning and then leave it opened. If I use the SystemExecution.vi, I can use the system instruction to execute the script, but this also starts Matlab. I don't think that using Math Script Node is a good idea, since the Matlab code is huge and consists of lots of m-files, therefore I don't want to paste the whole code into the Script Node. How can I do this? Regards, Gerald Hi Gerald, Some alternatives to consider: - You could try invoking your .m file script from MathScript by calling it from the MathScript node rather than inserting the entire script. To do so, you would save your script(s) in a folder that's part of the MathScript search path. (See the help for the path command (<a href="http://zone.ni.com/reference/en-XX/help/371361B-01/lvtextmath/msfunc_path/" target="_blank">here</a>) for more info about this search path.) - LabVIEW includes a "MATLAB Script Node" that allows you to call on an installed copy of The Math Works Inc. MATLAB� software to execute your m file scripts. This node coexists with LabVIEW graphical code as a "script node," a rectangular region that you can add to your LabVIEW block diagrams and use to enter or load .m files. When the node executes, LabVIEW calls the MATLAB software to execute the .m file script. See this &l...

Can i generate c code from matlab m-files I believe that c code can be generated from simulink models using rea time workshop but can the same be done using m-files instead of simulink. "arslan" <arsl_khalid@yahoo.com> wrote in message news:_KSdnfsQqo6d0srVnZ2dnUVZ_hSdnZ2d@giganews.com... > Can i generate c code from matlab m-files > I believe that c code can be generated from simulink models using real > time workshop but can the same be done using m-files instead of simulink. Look at MCS from AgilityDS http://www.agilityds.com/products/default.aspx Hans www.ht-lab.com arslan wrote: > Can i generate c code from matlab m-files > I believe that c code can be generated from simulink models using real > time workshop but can the same be done using m-files instead of simulink. Yes, if you have the matlab Compiler product. Otherwise you have to code by hand. There are third party converter products, but they aren't cheap. http://www.ancad.com/codeConverter.php On Jun 17, 1:43=A0am, "arslan" <arsl_kha...@yahoo.com> wrote: > Can i generate c code from matlab m-files > I believe that c code can be generated from simulink models using real > time workshop but can the same be done using m-files instead of simulink. Yes, I do it all the time, you have to first drag an embedded matlab block into simulink, then put your m code inside it, there are some limitations as far as what functions you can and cannot use...

Hello Matlab Community, I need help ASAP! Any thoughts/input on what might be going wrong would be appreciated. I'm new to creating Matlab GUIs. I have created a straight forward GUI that works fine in the Matlab enviroment and consists of simple static text, editable text and push buttons. When I compile to create a stand alone application using 'mcc -o outputfile -m guifilename.m', the warnings and errors below are generated (the GUI does pop-up when I click on the .exe file but does not function): - Warning: Could not find appropriate function on path loading function handle C:\Program Files\MATLAB\R2008a\toolbox\matlab\guide\guidemfile.m@<hObject,eventdata>MFL_GUI<'input1_Callback',hObject,eventdata,guidata<hObject>> > In hgload at 43 In openfig at 78 In gui_mainfcn>local_openfig at 271 In MFL_GUI at 16 (It loops over and over) Then the following: ??? Error using ==> struct2handle Undefined function handle ??? Error using ==> struct2handle Error while evaluating uicontrol CreateFcn Any help would be appreciated... Thanks, J J J wrote: > I need help ASAP! Any thoughts/input on what might be going wrong would > be appreciated. I'm new to creating Matlab GUIs. I have created a > straight forward GUI that works fine in the Matlab enviroment and > consists of simple static text, editable text and push buttons. When I > compile to create a stand alone applicat...

Here are my codes in my Cartoonisation.m file: function varargout = Cartoonisation(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Cartoonisation_OpeningFcn, ... 'gui_OutputFcn', @Cartoonisation_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end function Cartoonisation_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; guidata(hObject, handles); function varargout = Cartoonisation_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; The error that i get is: ??? function varargout = Cartoonisation(varargin) Error: Function definitions are not permitted at the prompt or in scripts. The name of my .m and .fig file is Cartoonisation.m and Cartoonisation.fig "Jaslyn " <jaslyn.tan88@gmail.com> wrote in message news:ji2dsb$lia$1@newscl01ah.mathworks.com... > Here are my codes in my Cartoonisation.m file: > > function varargout = Cartoonisation(varargin) *snip* > The error that i get is: > ??? function varargout...

i need to know how we calculate euclideandistance of a bitstream/codeword based on the channel gain of that particular codeword/bitstream subchannel ...

Hello All, I'm working with an aplication that use the matlab engine. I made the C++ program and it is working well in my pc with matlab 2007b, but the same very basic program shows an error when I tried to compile it in a pc with matlab R2010b. The error is about the icuuc32.dll. ¿Why is asking this DLL? How can I solve this?. Thanks¡ ...

What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit) I’m trying to import historical prices of stock data. Matlab keeps cutting off the header of each column; it gives me only values. I am thinking that this is a data-type-mixing-issue, or whatever it’s called. I have ‘Dates’ in ColumnA, and ‘MSFT’, ‘PWER’, ‘KO’, and ‘SBUX’, in ColumnB-ColumnE. Basically, if I put the Excel file in my Matlab folder and double-click the file, I see the values in a matrix (no dates and no headers), I hit ‘Next’. Then, I see only one option; one radio button is enabled – ‘Create variable matching preview’. The other two options, ‘Create vectors from each column using column names’ and ‘Create vectors from each row using row names’ – both are greyed out. I’ve seen videos, on YouTube and on the Matlab site, where people import excel data and these options are NOT greyed out. No matter what I do, there options are ALWAYS greyed out. The problem is, when I click ‘Finish’ in my ‘Workspace’ I have a variable named ‘data’ all values in a 575x4 matrix, but I have NO DATES and I have NO HEADERS on the columns. All of this seems to go into another variable, called ‘textdata’; all dates and headers ate in textdata. This is VERY inconvenient. I’m trying to analyze some stock data and I have no headers, so I have no idea which stock is which (I can figure it out, but I think Matlab should do this for me). Also, I have no dates corresponding to ...

I have an m file open in the editor, and it lives in say folder_A. is there a way from Matlab to tell it: please cd (make current folder) to the folder that this m file open in the editor is located in? If there is more than one m file open in the editor, I should be able to select one ofcourse, I can just type the command cd folder_A But the path is too long, and Matlab does not seem to allow me to copy the path shown at the top of the window banner so I can paste it on the console window. What would be nice, if from the editor itself, I can right-click on the file window, and have a pop-up window open with an option to 'cd to the folder this file is in' thanks, --Nasser I agree. Once Brett Shoelson at the Mathworks told me to put this at the start of my code: % Change the current folder to the folder of this m-file. if(~isdeployed) cd(fileparts(which(mfilename))); end I think it maybe used to work but now it doesn't. It asks me to change directory, or add to path before the m-file even runs and gets to that code. I've put in a request to have an option to do some kind of an auto-switch to the folder where your m-file lives when you try to run it but I don't think they liked that idea, so we are stuck with the annoying prompts all the time. It's especially bad for me because I work on several different projects that live in different folders so I'm always having to answer the prompt when an auto-switc...

Hi, I'm studying the performance of various space-time codes in MIMO systems (block codes, trellis codes, turbo trellis codes, VBLAST, D-BLAST). I need some MATLAB m-files about this. thanks, BITA I'm studying the performance of powerful sports cars and I need a Porche, a Ferrari and a Maserati. Plz e-mail me if you have these available. thanks Murphy. ...

Hi, My problem: I've a function myHelperFcn.m which needs myData.mat and myImage.jpg at runtime. I can include the needed files with the -a option of the mcc command, like this: mcc -m myFcn.m –a myData.mat -a myImage.jpg But I'm searching for a mechanism like the function pragma (%#function myCallbackFcn) for non m-files, which atomically includes the needed files to the ctf file. thanks, Martin ...

matlab -minimize -nodesktop -nosplash -r -wait mymfile;exit matlab -minimize -nodesktop -nosplash -r -wait resana;exit In using the above the commandline, I have to start matlab twice to run two matlab files i.e. mymfile and resana. I want to start matlab once and run two files before existing. How can I do this? On Wednesday, March 7, 2012 2:09:16 AM UTC+13, n o s p a m p l e a s e wrote: > matlab -minimize -nodesktop -nosplash -r -wait mymfile;exit > matlab -minimize -nodesktop -nosplash -r -wait resana;exit > > In using the above the commandline, I have to start matlab twice to run two matlab files i.e. mymfile and resana. I want to start matlab once and run two files before existing. > > How can I do this? Just append it: matlab -minimize -nodesktop -nosplash -r -wait mymfile;resana;exit ...

Sometimes, I rename my mfiles in the "Current Folder" window of the MATLAB session. Then, when I click on those files to open them in the editor, MATLAB renames them back to what they were formerly, literally in front of my eyes. I never noticed this prior to R2011b. Is this known behavior? Should this happen? "Matt J " <mattjacREMOVE@THISieee.spam> wrote in message news:jghsm4$154$1@newscl01ah.mathworks.com... > Sometimes, I rename my mfiles in the "Current Folder" window of the MATLAB > session. > Then, when I click on those files to open them in the editor, MATLAB > renames them back to what they were formerly, literally in front of my > eyes. I never noticed this prior to R2011b. > Is this known behavior? Should this happen? Matt- I think it would be appropriate to contact technical support on this issue. They'll be able to find the right people to help track this down. -- Loren http://blogs.mathworks.com/loren/ http://www.mathworks.com/matlabcentral/ On Feb 3, 7:04=A0pm, "Matt J " <mattjacREM...@THISieee.spam> wrote: > Sometimes, I rename my mfiles in the "Current Folder" window of the MATLA= B session. > Then, when I click on those files to open them in the editor, MATLAB rena= mes them back to what they were formerly, literally in front of my eyes. I = never noticed this prior to R2011b. > > Is this known behavior? Should this happen? -------------------...

Many of you who post to this newsgroup are also regular contributors to the MATLAB Central File Exchange. Look for your favorite contributors on our File Exchange Author Profile page. You can read their profiles and see pictures: <http://www.mathworks.com/matlabcentral/reports/fileexchange/allProfiles/> In a random drawing, we recently awarded MATLAB jackets to three File Exchange authors with profile pages: Michele Giugliano, Andrey Egin, and Denis Gilbert. You can win a jacket, too. Just submit a new file to the File Exchange or update your author profile by December 2003 for a chance to win one of four MATLAB jackets. See the jacket below: <http://www.mathworks.com/matlabcentral/images/jeff3.jpg> Here are some interesting File Exchange facts: - Since its inception in 2001, visitors have downloaded more than 1.25 million submissions from the File Exchange. - In September 2003 alone, visitors downloaded 80,085 files, an average of 2670 a day! .... what if the prize was a free copy of the next version of Matlab :-) majb Min Poh wrote: ....or an offer for employment... aj "bourassa" <bourassa-m@rmc.ca> wrote in message news:3f9d507d$1@rmcnt03a.rmc.ca... > ... what if the prize was a free copy of the next version of Matlab :-) > > majb > > Min Poh wrote: > ...

I am trying to to some computations and I would like to do it in parallel using parfor or by Opening the matlabpool.. as the current implementations is too slow: result=zeros(25,16000); for i = 1:length(vector1) % length is 25 for j = 1:length(vector2) % length is 16000 temp1 = vector1(i); temp2 = vector2(j); t1 = load(matfiles1(temp1).name) %load image1 from matfile1 t2 = load(matfiles2(temp2).name) % load image2 from matfile2 result(i,j)=t1.*t2 end end It work fine but I would really like to know if there is a way to speed thing up ... Thanks a lot in advance! ...

I was using matlab central's tool called exportToZip() to package an m file and its dependencies m files into one zip file. The problem is that this tool does not package a .fig file as well, that corresponds to an .m file (assuming such one exist, example for GUIDE application). So, in my Matlab script, I detect this, and then tried to add the .fig file to the zip file that was created. But after looking at the zip() command, it does not seem to support adding a file to a zip file? Or Am I missing something? I am using 2010a on windows. How else would one add a file to a zip file using Matlab? I can try using the system() command, but windows 7 does not seem to have a zip command at the DOS level. thanks --Nasser On 2/15/2012 12:11 AM, Nasser M. Abbasi wrote: > I was using matlab central's tool called exportToZip() to > package an m file and its dependencies m files into one zip file. > > The problem is that this tool does not package a .fig file > as well, that corresponds to an .m file (assuming such > one exist, example for GUIDE application). > > So, in my Matlab script, I detect this, and then tried > to add the .fig file to the zip file that was created. > > But after looking at the zip() command, it does not seem > to support adding a file to a zip file? > > Or Am I missing something? > > I am using 2010a on windows. How else would one add a file > to a zip file using Matlab? I c...

Hello everyone, I have a matlab in class exercise due in few days. I am new to matlab and the instructions provided with the assignment is minimal. Can Someone help me with the basic understanding as in how can I map the problem's solution to matlab script ? I am not able to post question here as it is a jpeg file. Please let me know and then we can discuss further. ...

hello...i m using MATLAB 2010a from last 2 weeks & there was no problem in saving the files in Matlab.but today whien i started saving my files in matlab they jst didn't save. There was no error message.Simply the files stopped from saving.Kindly guide me through this. "Megha Aggarwal" wrote in message <jk6ljo$44i$1@newscl01ah.mathworks.com>... > hello...i m using MATLAB 2010a from last 2 weeks & there was no problem in saving the files in Matlab.but today whien i started saving my files in matlab they jst didn't save. There was no error message.Simply the files stopped from saving.Kindly guide me through this. Did you by any chance overload the SAVE command? Put which save ... right before the save command takes place to make sure you are still using the builtin function. Bruno ...

Resources last updated: 3/30/2016 3:01:19 PM