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

This is a small part of my whole project (Speech/Music Discrimination). I can wavread all the wave files when the code is in the current directory. Using this file=dir('*.wav'); for i=1:length(file); [s, fs]=wavread(file(i).name); commands statements etc, in here... end The problem is i want to used this code to other folders without moving it in that directory. For example there are wave files in the Musicvoice folder I edited the code to something like this to access the wave files in the Musicvoice. file=dir('Musicvoice\*.wav'); for i=1:length(file); [s, fs]=wavread(file(i).name); commands statements etc, in here... end It gave me the error below. Please help. ??? Error using ==> wavread Cannot open file. Error in ==> extractFeature at 16 [s, fs]=wavread(file(i).name); %wavread function returns s and the sampling frequency kingdavid3 wrote: > This is a small part of my whole project (Speech/Music > Discrimination). I can wavread all the wave files when the code is in > the current directory. > > Using this > > file=dir('*.wav'); > > for i=1:length(file); > > [s, fs]=wavread(file(i).name); > > commands statements etc, in here... > > end > > The problem is i want to used this code to other folders without > moving it in that directory. For example there are wave files in the > Musicvoice folder I edited the code t...

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

Hi Maybe a too easy problem for you but maybe you help me to solve this in MATLAB I have a vector of point let say for example sin(x) from -PI to PI and I would like to plot the -- vector -- derivative of the vector -- integral of the vector any idea how do do this in MATLAB Thks On 8/5/2012 1:15 PM, mourad wrote: > Hi > Maybe a too easy problem for you but maybe you help me to solve this in > MATLAB > I have a vector of point let say for example sin(x) from -PI to PI > and I would like to plot the > -- vector > -- derivative of the vector > -- integral of the vector > doc plot doc diff doc trapz -- ...

Long story short, here is the criteria I need. 1) I need two modules running in parallel. One function must activate these two They don't need to START at the same time but both neither return info nor end. They run pretty much infinitely 1.1) I would prefer if the One function also ran separate from the above two in it's own loop but i can deal with a 3'rd function also not ending. 2) I need a shared variable between two of the modules. 1 Module will place information there while the other just reads it, but as they are running parallel. That's it. I can do this in pretty much any other language but matlab I've been having issues with. Problem is I absolutely need to use matlab for one module. If this is impossible to accomplish all in matlab then can i instead run this in C and call one matlab module with separate thread? Sample code below. function mainParallelTest() persistent counter; counter = 0; parfor i=0:2 if (i == 0) ImageProccessorParallelTest(); elseif(i == 1) EventProcessorParallelTest(); elseif(i == 2) prevCounter = 0; tempCounter = 1; while(true) tempCounter = counter; if (tempCounter == prevCounter) %disp('hi') end prevCounter = tempCounter; end end end "Alex Cruikshank" <cruiksam@gmail.com> writes: > Long story short, here is the criteria I need. >...

Hi I am trying to simulate the low pass filtered output of a square wav (pulse train) using Matlab. The pulse varies between 0 and 1. So th filtered output looks somewhat like a sinewave. The filter is a low pas filter (FIR/raised cosine filter). Essentially what I need is to be abl to generate a look up table that will store the output waveform rise fall transition (from 0-1 and 1-0). So what i want essentially is to b able to generate a look up table of different lengths (like 100,50 etc) t store these transitions. I tried using Simulink for this, but havent bee successful so far. So my table will look something like 1 0.995 0.923 0.91 0.85 ..... to 0 Any help is highly appreciated. Thanks. Best regards Vikram ...

Hi, I am new on neural network toolbox. I am trying to use LVQ algorithm,but it is not working at all. Right now I am trying to train the network for a simple sine curve, but it is not trained according to the target. Can you help me with your suggestion, my function is y=sin(x); x is my input and y is my target output. I classified target results in four different classes. 0.5<=value<=1.0; class 1 0.0<=value<0.5; class 2 -0.5<=value<0.0; class 3 -1<=value<-0.5; class 4 I would highly appriciate if you help me with some idea, i am stucked here for a long time. Here is the code I am using, --------------------------------------------------- t=-5:.1:5; x=t; for i=1:length(x) y(i)=sin(x(i)); end for i=1:1:length(y) if(0.5<(y(1,i)) && (y(1,i))<=1) tc1(1,i)=1; end end for i=1:1:length(y) if(0<=(y(1,i)) && (y(1,i))<0.5) tc1(1,i)=2; end end for i=1:1:length(y) if(-0.5<=(y(1,i)) && (y(1,i))<0) tc1(1,i)=3; end end for i=1:1:length(y) if(-1.0<=(y(1,i)) && (y(1,i))<-0.5) tc1(1,i)=4; end end p1=x; check(1,:)=p1; check(2,:)=tc1; checkall=sortrows(check,2); p=checkall(1,:); tc=checkall(2,:); t=ind2vec(tc); targets=full(t); sc=16; calu(1,1)=sum(targets(1,:)); calu(2,1)=sum(targets(2,:)); calu(3,1)=sum(targets(3,:)); calu(4,1)=sum(targets(4,:)); c1=calu(1,1)/(sum(calu(1,1)+calu(2,1)+calu(3,1)+calu(4,1))); c2=calu(2,1)/(sum(calu(1,1)+calu(2,1)+calu(3,1)+calu(4,1))); c3=calu...

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

Is their anybody help me in calculating the bit error rate of OFDM SIGNAL for BPSK, QPSK AND QAM SIGNAL in the papr reduction techniques like clipping and Selective level mapping, if anyone is having coding for the same please mail me on pmjadhav85@gmail.com. ...

can anyone tell me whats wrong with this? =[ function[y]=horner_scheme (a,x) n = 1:n; b(n)=a(n); for i=n-1:-1:0 b(i)=((b(i+1))*x)+a(i); end y = b(0); im pretty sure all is right, except i keep getting the message 'the variable n can be used before it is defined' =S (line 2..) what does that mean? "matlabnoob noob" <counternoob@hotmail.co.uk> wrote in message news:gouo8d$rdl$1@fred.mathworks.com... > can anyone tell me whats wrong with this? =[ > > function[y]=horner_scheme (a,x) > n = 1:n; > b(n)=a(n); > for i=n-1:-1:0 > b(i)=((b(i+1))*x)+a(i); > end > y = b(0); > > > im pretty sure all is right, except i keep getting the message 'the > variable n can be used before it is defined' =S (line 2..) > > what does that mean? What do you think the value of n is? What are you trying to achieve with the line n=1:n; ? Arnaud "matlabnoob noob" <counternoob@hotmail.co.uk> wrote in message <gouo8d$rdl$1@fred.mathworks.com>... > can anyone tell me whats wrong with this? =[ > > function[y]=horner_scheme (a,x) > n = 1:n; > b(n)=a(n); > for i=n-1:-1:0 > b(i)=((b(i+1))*x)+a(i); > end > y = b(0); > > > im pretty sure all is right, except i keep getting the message 'the variable n can be used before it is defined' =S (line 2..) > > what does that mean? No, you are not getting it right. You were told in your...

Hey, So im reworking a code. GUI with 3 buttons, all 3 button play songs when loaded from a file, So im using Audioplayer and its playing Button 1, but when i press button 2, Button 1 is still playing and button 2 also plays and so on with button 3... So my question is, what do I do so when Button 1 is playing and I press Button 2, Button 1 music is stopped and Button 2 music starts playing, same with Button 3. (I dont want to add any other buttons, I want it to stop automatically when I press other button and plays that song). function myplay(file) if isunix, %using system's play (from the sox package) on Unix (MATLAB's sound does not work) [s,w]=unix(['play ' file]); else, %using MATLAB's wavplay on Windows [y,fs]=wavread(file); player=audioplayer(y,fs); play(player); pause(max(size(y))/fs); end ...

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

Hi all, I'm building a java swing based GUI for my Matlab application. As such, user input is available as text strings, for example "{[0; 0], [3.5 0; 0 2]}" (mean vector and covariance matrix of a 2D Gaussian). The user input will be passed to the compiled matlab method as a MWCellArray. Problem is how do a convert (parse) the above string into a MWCellArray? From its javadoc http://www.mathworks.com/access/helpdesk/help/toolbox/javabuilder/MWArrayAPI/index.html the following method is available: java.lang.String toString() Returns a string representation of this array, but the reverse method is not. Evidently, parsing a string like the one above is a non trivial task and I'm loath to attempt writing one by myself. I would be very thankful if someone can point me to the required parser implementation. Matlab itself is carrying out this task all the time, perhaps it is possible to access Matlab's own parser. Help much appreciated, Ritesh ...

Hello all, I need to find the optimal value of x for the function (1- x^2/2R^2)^(1/x) in terms of R. Could someone please help, how I could do it in Matlab? Thanks a million, --Johnson fminsearch or fminbnd User10 wrote: > > > Hello all, > > I need to find the optimal value of x for the function (1- > x^2/2R^2)^(1/x) > in terms of R. > Could someone please help, how I could do it in Matlab? > > Thanks a million, > --Johnson > > > ...

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. % % Adam Wunderlich % 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] % % Adam Wunderlich % 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 -...

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 everybody I'm desperate. I'm preparing a program in matlab and really i'm having to many problems. In a matrix 10x10, i want to solve laplace's equation with an iterative method in a 2 dimensional space. I have a mountain defined by zeros in the matrix. I want to calculate the speed and direction of the wind, setting the next boundary conditions: Upper part: no vertical fluid lower part at both sides of mountain: no verical fluid lateral: only a constant and horizontal fluid My problem is the mountain. How can I program the method so that the fluid in the border of the mountain is tangent?? Really I need help, don't know what to do. I have tried some options and I cannot make the method to converge! Any help would be appreciated Thanks a lot in advance and sorry for my english Inigo ...

Hi all, I have written some code in Matlab. Can i directly convert this ".m" file into C code (.c/.cpp file). If there is anytool in Matlab or anywhere please tell me . thanks and regards yogesh You will need the MATLAB compiler (mcc) for which a separate licence is required. <help mcc> Roy http://www.danielsorogon.com/Webmaster "yogesh kumar" <yogesh_kec@rediffmail.com> wrote in message news:qo1gtbpi9sha@legacy... > Hi all, > I have written some code in Matlab. Can i directly convert this > ".m" file into C code (.c/.cpp file). If there is anytool in Matlab or > anywhere please tell me . > thanks and regards > yogesh > ...

Hi all, i am using matlab and encountered some problems. Kindly advice. 1)i am using newff function to create a neural network.After which someone advised me to set some of the parameters ,for example net.performFcn,net.trainParam.goal and many more. But i tried using m matlab help and search for function to llok up for what these parameter do. However, i can't find any help on these parameters. Where can i fin them? 2)i intend to use the train function to train my network. In the trai function, according to the help file,we can also give T(network targets as input. Can someone kindly explain to me what is network targets? 3)while processing the image,i came across something like y=[13x logical], what does it mean? Why cant i look into the content? When i tr to do sum(y(:,1)), it gives an error saying "Function 'sum' is not define for values of class 'cell'." However, if i use it in an while loo comparison statement, there is no error. Why? 4)If i want to do hardware implementation,i have to convert my code i matlab to C++, am i right? If so, is there anyway to do so or must i writ them out in C++ format all over again? Thanks & Regards doggie skrev: > Hi all, i am using matlab and encountered some problems. Kindly advice. If you have general questions about matlab, comp.soft-sys.matlab would probably be a better place to start. DSP-related questions involving matlab are likely to be answered here. > 4)If i want to do hardwa...

hii everyone. please tell me, how to use 'parfor' function ? it's syntax(es) and the Matlab version(s) which support 'parfor'. also, if possible, please tell me how to realise 'file-management' in Matlab environment; the commands and the rules for it. ------- ashutosh srivastava "ashutosh srivastava" <srivastava_ashu1987@in.com> writes: > please tell me, how to use 'parfor' function ? it's syntax(es) and > the Matlab version(s) which support 'parfor'. PARFOR was introduced in R2007b of MATLAB. The doc is here: <http://www.mathworks.com/access/helpdesk/help/toolbox/distcomp/brb2x2l-1.html> Cheers, Edric. thanks Edric for your assistance. ...

As part of my college engineering thesis, I have been assigned the task of identifying and locating sounds using MATLAB. So far, all I have is a two-microphone set-up, which comprises the audio signal for analysis. This is split up into two vectors in matlab, and using the time delay information, I need to be able to locate the sound. I've done a fairly basic frequency analysis just to get some background information on the sound, but now I need to output the distance and angle as answers! Any information would be greatly appreciated, as all of the resources on the internet tend to go into advanced acoustic theory which is way over my head! staplep wrote: > As part of my college engineering thesis, I have been assigned the task of > identifying and locating sounds using MATLAB. So far, all I have is a > two-microphone set-up, which comprises the audio signal for analysis. This > is split up into two vectors in matlab, and using the time delay > information, I need to be able to locate the sound. I've done a fairly > basic frequency analysis just to get some background information on the > sound, but now I need to output the distance and angle as answers! Any > information would be greatly appreciated, as all of the resources on the > internet tend to go into advanced acoustic theory which is way over my > head! Location is usually accomplished by measuring the difference between the delays of pairs of signals. Barring reflections tha...

I am trying to implement a bandpass filter on a signal data, xx. It is of 200,000 samples and the sampling frequency is 40 kHz. I am using a butter filter function and my program is as followed: HalfFs = Fs/2 Wp = [1000 1550]/HalfFs; Ws = [950 1600]/HalfFs; Rp = 3; Rs = 40; %Calculate the minimum order of Butterworth filter [n,Wn] = buttord(Wp,Ws,Rp,Rs) [b,a] = butter(n,Wn); yy - filter (b,a,xx); xx = conv(xx,yy); my program always hang upon the convolution step...does anybody knows how to solve this program? Should work, but try storing convolution output to something other than an input, e.g. zz = conv(xx,yy); xx = zz; You should also try a smaller sequence, say 10000 samples, first and then increase the size slowly. Sometimes matlab, because it allows dynamically resizing arrays, can get stuck in malloc cycles or memory swaps and can seem to take forever. Especially if your machine doesn't have a lot of memory. -Clark <buggue@hotmail.com> wrote in message news:1142156054.386572.263770@u72g2000cwu.googlegroups.com... > I am trying to implement a bandpass filter on a signal data, xx. It is > of 200,000 samples and the sampling frequency is 40 kHz. > > I am using a butter filter function and my program is as followed: > > HalfFs = Fs/2 > Wp = [1000 1550]/HalfFs; Ws = [950 1600]/HalfFs; > Rp = 3; Rs = 40; > > %Calculate the minimum order of Butterworth filter > [n,Wn] = buttord(Wp,Ws,Rp,Rs) > > [b,a] = butter(n,Wn); ...

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

Undocumented, unsupported and hidden features in Matlab

... 23°21′N 90°42.5′E / 23.35°N 90.7083°E / 23.35; 90.7083 Coordinates : 23°21′N 90°42.5′E / 23.35°N 90.7083°E / 23.35; 90.7083 Matlab ...

The MathWorks - Developers of MATLAB, Simulink and Stateflow. Offers products for data analysis, visualization, application development, simulation, ...

Read reviews, compare customer ratings, see screenshots, and learn more about MATLAB Mobile. Download MATLAB Mobile and enjoy it on your iPhone, ...

In the aftermath of an earthquake, every second counts for disaster victims. Imagine a system that can locate people quickly and help first responders ...

What prompted the development of MATLAB?

If you are trying to compile Matlab into .Net framework, you might encounter this message, even though you have the .Net framework installed ...

Matlab, one of the world's most widely used products for algorithmic development, has long occupied its own niche far removed from EDA and hardware ...

dmtcp - DMTCP: Distributed MultiThreaded CheckPointing matlab -nodisplay -r "parpool('local',4); parfor i=1:10, pause(1); fprintf('%i ',i); end; ...

... so he focused on studying the methodology and the tools available for analyzing 433MHz RF transmission. He describes the process of using MATLAB ...

Resources last updated: 3/30/2016 12:39:28 PM