f



Few matlab questions

Hello,

I have this questions for you. I hope some one can help me.
So I have a background image and I want to insert another image over it. A ball for example. But this ball get on top of the background and it streches to full screan.

1) How to make matlab plot a picture in its original size. I don`l want to be stretched.
2) My ball picture is a PNG file so i need not to show the transparent pixels. I used:
                A = imread('ball.png','BackgroundColor','none');
                image(A)
but it isn`t working.. 
3) Can I load an animation or sound  in the plot figure. For example if we have a goal then some fireworks appears or sound?

This is every thing I have to ask. Than you very much if some on can help me!
0
nikone (3)
6/4/2011 1:30:21 PM
comp.soft-sys.matlab 211266 articles. 18 followers. lunamoonmoon (258) is leader. Post Follow

1 Replies
379 Views

Similar Articles

[PageSpeed] 58

You might have to overwrite the original pixels like this demo does:

% Read in a standard MATLAB gray scale demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
baseFileName = 'mandi.tif';
fullFileName = fullfile(folder, baseFileName);
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
	% Didn't find it there.  Check the search path for it.
	fullFileName = baseFileName; % No path this time.
	if ~exist(fullFileName, 'file')
		% Still didn't find it.  Alert user.
		errorMessage = sprintf('Error: %s does not exist.', fullFileName);
		uiwait(warndlg(errorMessage));
		return;
	end
end
grayImage1 = imread(fullFileName);
% Get the dimensions of the image.  numberOfColorBands should be = 1.
[rows1 columns1 numberOfColorBands1] = size(grayImage1)

% Read in a second standard MATLAB gray scale demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
baseFileName = 'cameraman.tif';
fullFileName = fullfile(folder, baseFileName);
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
	% Didn't find it there.  Check the search path for it.
	fullFileName = baseFileName; % No path this time.
	if ~exist(fullFileName, 'file')
		% Still didn't find it.  Alert user.
		errorMessage = sprintf('Error: %s does not exist.', fullFileName);
		uiwait(warndlg(errorMessage));
		return;
	end
end
grayImage2 = imread(fullFileName);
% Get the dimensions of the image.  numberOfColorBands should be = 1.
[rows2 columns2 numberOfColorBands2] = size(grayImage2)

% Figure out where to place image 2 over image 1.
upperLeft = [800, 1600];
row1 = upperLeft(1);
row2 = row1 + rows2 - 1;
col1 = upperLeft(2);
col2 = col1 + columns2 - 1;
% now make sure image2 won't stick out past the edges of grayImage1.
% Clip coords and grayImage 1 if that would happen.
% Write it in, replacing the pixels of image2
grayImage1(row1:row2, col1:col2) = grayImage2;
imshow(grayImage1)
axis on;

For sound, yes you can play sounds.  From the help:
play

Play audio from audioplayer object
Syntax

play(playerObj)
play(playerObj, start)
play(playerObj, [start stop])

Yes, you can also show movies in an axes.
		% Read the file into a MATLAB movie structure.
		myVideo = aviread(fullImageFileName);
		myVideoParameters = aviinfo(fullImageFileName);
		numberOfFrames = myVideoParameters.NumFrames;

		% Play the movie in the axes.  It doesn't stretch to fit the axes.
		% The macro will wait until it finishes before continuing.
		movie(handles.axesImage, myVideo);


See MAGIC for a working demo:
http://www.mathworks.com/matlabcentral/fileexchange/24224
0
imageanalyst (7623)
6/4/2011 3:08:05 PM
Reply:

Similar Artilces:

Matlab engine with matlab R2010b
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¡ ...

embedded matlab function MATLAB R2009a
I downloaded the MS visual C++ 2008 Express Edition and the SDK as detailed in http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L My embedded function didnt work at the beginning because I did "mex -setup" before I installed my SDK. But after I installed the SDK, I ran "mex -setup" in Matlab once again and choose the MS visual C++2008 as my compiler. Then, my embedded matlab function worked. Thanks to the contribution from above! ...

Why does Matlab do this
What is happening when I type rand(1:10) at the command line? Matlab goes into a 10 minute spin - what's going on? Thanks "Robert" wrote in message <j64asi$5v4$1@newscl01ah.mathworks.com>... > What is happening when I type > rand(1:10) > at the command line? > > Matlab goes into a 10 minute spin - what's going on? > Thanks Hi Robert, You're create a 10-D array with that syntax. Do you just want a vector of 10 uniformly distributed random numbers. x = rand(10,1); % or x = rand(1,10); Wayne Hi Wayne, You're right - that's what I was trying to do... but I was just newbie mucking about trying to work out the syntax and I typed that in - then had a looong wait for Matlab to work through it! Thanks for the explanation. Robert "Robert" wrote in message <j64d2h$dvo$1@newscl01ah.mathworks.com>... > Hi Wayne, > You're right - that's what I was trying to do... but I was just newbie mucking about trying to work out the syntax and I typed that in - then had a looong wait for Matlab to work through it! > Thanks for the explanation. > Robert That's fine. Welcome to MATLAB!!! If that's the worst memory-intensive mistake you ever make, you'll be fine :) I've done much, much worse. Wayne ...

a question about fft in matlab
hello guys, This may be a simple question for some of you but I am confused and will really appreciate your help. I have a semi circular 1D signal (assuming all values outside the circular diameter are 0). I want to recover the width of the signal from the Fourier transform of the signal by looking at the zero crossing. I create the signal as follows: radius = 20; icenter = 100; length = 200; x = linspace(-icenter/2, icenter/2, length); for i = 1:length f(i) = 2*sqrt(r^2 - x(i)^2); end So, I get a semi-circular signal f( ). Now, I do a FFT of f( ) F = fft(f); My question is how can I use the first zero crossing of F and recover the "value of the radius" of the original circular signal? secondly, Is there any way by which I can calculate the zero crossing of F (above) automatically in matlab? The FFT has the form (2 * pi * JI (w * radius))/ (w * radius). thank you in advance. On 3 Mar 2006 19:44:02 -0800, "nic@gmail.com" <singhnic@gmail.com> wrote: >hello guys, > >This may be a simple question for some of you but I am confused and >will really appreciate your help. > (snipped) >The FFT has the form (2 * pi * JI (w * radius))/ (w * radius). > >thank you in advance. Hi, what does the "JI" mean in your above FFT expression? You said you "want to recover the width of the signal from the Fourier transform". Wouldn't it be easier to measure the width of your 1D signal (the diameter...

Contribute to MATLAB Central and Win a MATLAB Jacket
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: > ...

Matlab parallel for loop or Matlab open pool
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! ...

MATLAB /SIMULINK question
I would like to ask how do i read the spectrum scope output in simulink its y axis is in dB from 0 to -100 and x axis from 0 to 0.5 in Hz. I find it weird since my filter response is surpossed to at much higher freq but the output on scope shows response within range of 0 to 0.5 on x axis in units of Hz On 22 Mar, 08:03, "Bryan" <s...@xilinx.com> wrote: > I would like to ask how do i read the spectrum scope output in simulink > its y axis is in dB from 0 to -100 and x axis from 0 to 0.5 in Hz. > > I find it weird since my filter response is surpossed to at much higher freq > but the output on scope shows response within range of 0 to 0.5 on x axis in > units of Hz Seems to me that the sampling frequency hasn't been set? If you don't set it yurself, a good implementation of an analyzer will use a default value instead. Fs = 1 Hz is a natural choise for such a default value. Rune ...

matlab question #11
write program that reads the IDS and test scores for several students as input.Find and display the ID and the score for the students who had the largest score. ...

matlab output question
Hi, I have a matlab question: Suppose I want to output to a file with the following format: "190" r2pos "219" "193" r2pos "220" "202" r2pos "203" "205" r2pos "216" "207" r2pos "226" "229" r2pos "230" "236" r2pos "237" The two columns of numbers are recorded in the variables x and y. I use fprintf but can not get the " symbol in the file. Does any body know how to do this? Thanks. Jane Hi, try this : x=190; y=219; fprintf('"%d" r2pos "%d"',x,y) J�r�me Thus spake <Jane>: > Hi, > I have a matlab question: > Suppose I want to output to a file with the following format: > > "190" r2pos "219" > "193" r2pos "220" > "202" r2pos "203" > "205" r2pos "216" > "207" r2pos "226" > "229" r2pos "230" > "236" r2pos "237" > The two columns of numbers are recorded in the variables x and y. I > use fprintf but can not get the " symbol in the file. Does any body > know how to do this? > > Thanks. > Jane Try: tmpl=['"' '%d' '"' ' r2pos "' '%d' '"\n' ]; fprintf(tmpl,[x; y]) /PB -- A: Because it messes up the ord...

matlab Question #12
Implement the statistical edge detection filter [1] (attached) in MATLAB and choose a 7×7 mask and implement the F and T tests. Then present a range of images to the filter and display the filtered images. Histogram equalization should be applied to the implementation. Different masks should be use to compare the outcome. • Implement non-maximal suppression in the edge detection to sharpen up the edge. • Implement a different size of mask and also compare the performance of this algorithm with the Canny edge detector on the same images, drawing conclusions about their relative performance on noisy, clean, textured and cluttered images. A A 0 B B A A 0 B B A A P B B A A 0 B B A A 0 B B Figure.1: 135o mask 0 B B B B A 0 B B B A A P B B A A A 0 B A A A A 0 figure.2: 135o mask Figures 1and 2 are examples of a 90o 135o masks, where the two regions for each masks are denoted by A and B, the pixel of interest is denoted by P and the 0’s denoting the separating line between the two masks (these pixels are ignored during the calculations). You should generate other masks for 0o, 45o etc. Once you have generated these masks within MATLAB, you need to scan the masks through the image and read the pixels by its two areas and then calculate statistical parameters (standard deviations and variations) of regions A and B using the var ( ) function in MATLAB. The next step will be implementing ...

Need help for a matlab mini project
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. ...

Matlab automation server and Matlab Compiler Run Time
I did a simple excel macro which runs matlab functions sucessfully in a machine with Matlab installed. Now I want to run it in a computer without matlab, with "MATLAB Compiler Run Time" installed. I can add the Matlb automation server type file (mlapp.tlb) sucessfully, but when I try to run it, I get this error: "ActiveX component can't create object" In this line: Set matlab = New MLApp.MLApp Do you know what is missing? Thanks ...

Call Matlab m-file from Matlab Scrip Node
My problem with matlab script node is related to calling function in matlab.&nbsp; I created an m-file function that takes an imput temperature (from DAQ) and defines a material property.&nbsp; My matlab script node doesn't seem to recognize my function.&nbsp; I have placed the function in the folder the vi is currently located, but it doesn't read it.&nbsp; 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, &nbsp; I have pasted my matlab code into the matlab scrip node. &nbsp; In this code, I have called a subfunction that I have created. &nbsp; Example k(n)=k_c(T(n)) where k_c is a subfunction I have created. &nbsp; How do I get my code in the node&nbsp;to sucessfully read the subfunction k_c? &nbsp; &nbsp; &nbsp; 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.&nbsp; My matlab script node is working properly.&nbsp; I had never used the "cd" command in matlab.&nbsp; I always set the working directory when I open the program, and put all the m files into t...

Matlab builder JA: parse java string to matlab cell
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 ...

Matlab student license for MDSD (e.g. Matlab Coder)
Hello, I'm evaluating products for writing my final university thesis. I want to perform image processing algorithms (C-Code compiled for a DSP). I have the feeling that manual programming of this algorithms is no longer state of the art. Instead MDSD (model driven software development) - that means Code Generation - seems to be smarter to me. Unfortunately Mathworks offers no licenses of Matlab Coder (or Simulink Coder etc.) to individual students. And I cannot afford to buy a commercial license (which probably would cost me more than 5.000 EUR/$ / my absolute limit is 1.000 EUR/$). Is there any possibility for me to use MDSD (code generation) for image processing for my university thesis ? Maybe by using cheaper alternatives ? Or by using 3d party software (like target link) ? Or export/import to another product ? Any idea ? (I want to avoid manual coding - like using OpenCV) By the way, does anyone know, why Mathworks hides the MDSD features from students ? It doesn't make sense to me that Mathworks reduces the amount of engineers available on the job market that are capable of handling (serious) Matlab projects. (Microsoft offers the "Visual Studio Express Edition" for free for education and the amount of people on the job market that are experienced in Visual Studio is tremendous.). Thank you, Roelof ...

Simple Maths/MATLAB Question
Hi, I have a quadrilateral defined by [x1 x2 x3 x4] and [y1 y2 y3 y4] which define the 4 vertices in anticlockwise order. How can I determine quickly in MATLAB whether the point [xn yn] is within the area of the quadrilateral? Thanks in advance for your time. Oli OliH wrote: > > > Hi, > > I have a quadrilateral defined by [x1 x2 x3 x4] and [y1 y2 y3 y4] > which define the 4 vertices in anticlockwise order. How can I > determine quickly in MATLAB whether the point [xn yn] is within the > area of the quadrilateral? > > Thanks in advance for your time. > > Oli help inpolygon <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/inpolygon.html> Try something like this : in=inpolygon(xn,yn,[x1 x2 x3 x4 x1],[y1 y2 y3 y4 y1]); J�r�me Thanks so much. There's always the odd function you've never seen before isn't there! Oli J�r�me wrote: > > > OliH wrote: >> >> >> Hi, >> >> I have a quadrilateral defined by [x1 x2 x3 x4] and [y1 y2 y3 y4] >> which define the 4 vertices in anticlockwise order. How can I >> determine quickly in MATLAB whether the point [xn yn] is within > the >> area of the quadrilateral? >> >> Thanks in advance for your time. >> >> Oli > > help inpolygon > <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/inpolygon.html> > > Try something like this : > > in=inpolygon(xn,yn,[x1 x2 ...

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

Matlab question for Newton Raphson
Need to do 5 iterations...for this problem not including 0 which is 1 and 0 f1(x1, x2) = 10x1sinx2 + 2 = 0 f2(x1, x2) = 10x1^2? 10x1cos x2 + 1 = 0 where x0 = [ 1 ; 0] x01 = 1 x02 = 0 Please need the code plus the first five iterations for x1 and x2.....ive been trying but...keep getting errors..and its due tomorrow lol :( at 5:30 latest "Carlos Mallqui" wrote in message <jnaeda$p5b$1@newscl01ah.mathworks.com>... > Need to do 5 iterations...for this problem not including 0 which is 1 and 0 > > f1(x1, x2) = 10x1sinx2 + 2 = 0 > f2(x1, x2) = 10x1^2? 10x1cos x2 + 1 = 0 > > where x0 = [ 1 ; 0] > > x01 = 1 > x02 = 0 > > > Please need the code plus the first five iterations for x1 and x2.....ive been trying but...keep getting errors..and its due tomorrow lol :( at 5:30 latest Please post your code so we can comment on it. James Tursa maxiter = 5; tol=1e-6 x=[1 0]%initial extimates f=(10*x(1)*sin(x(2)))+2;%function fx1=10*sin(x(2));%derivative of function w.r.t x1 fx2=10*x1*cos(x(2));%derivative of function w.r.t x2 J=[fx1 fx2] %Jacobian matrix of function xold = x(:); xnew = xold - J\f for k=1:maxiter xold = xnew; niter = k; xnew = xold - J\f; if abs(xold-xnew)/abs(xnew) < tol (niter == maxiter) break end end r = xnew like this try for the next function also "prabhakaran m" <prabha.gahon@gmail.com> wrote in message <jnaip9$c68$1@newscl01ah.mathworks.com>... > > f=(10*x(1)*...

A question about C+Matlab, thanks
Dear all, I have used C to write a MEX file, the program is attached at the end of this message. The question is that when I use this program to read an image, the pixel data are not same to when I use Matlab to read the same image. For example, when I read the first 16 lines and first 16 columns in Matlab, all the pixel values are 0. However, then I read the same image block in C, some pixel values are 255. Can somebody help me with this? Thank you very much. void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *imageData, pixelData; int hei, len, blockSize, dBlockSize; int i, j, i0, j0; int rs, cs; FILE *fp; imageData = mxGetPr(prhs[0]); hei = mxGetM(prhs[0]); len = mxGetN(prhs[0]); blockSize = (int)mxGetScalar(prhs[1]); dBlockSize = blockSize / 4; if ((fp = fopen("C:\\test_MEX", "wb") == NULL) printf("Open test text file error!\n"); // plhs[0] = mxCreateDoubleMatrix(hei, len, mxREAL); // SPM = mxGetPr(plhs[0]); for (i=blockSize/2; i<hei-blockSize/2; i+=dBlockSize) { for (j=blockSize/2; j<len-blockSize/2; j+=dBlockSize) { i0 = i-blockSize/2; j0 = j-blockSize/2; for (rs=0; rs<blockSize; rs++) { for (cs=0; cs<blockSize; cs++) { pixelData = imageData[(i0+rs)*len + j0+cs]; fprintf(fp, "%4.1f ", pixelData); } fprintf(fp, "\n"); } fprin...

Questions about matlab curve fitting
Hello all=EF=BC=9A I have written a matlab curve fitting program=EF=BC=9A clc clear xx =3D 1:1:20; xx =3D xx'; yy =3D exp(xx); hold on; plot(xx,yy,'o'); start =3D [1 1 1]; s =3D fitoptions('Method','NonlinearLeastSquares',... 'Lower',[-Inf,-Inf,-Inf],... 'Upper',[Inf,Inf,Inf],... 'Startpoint',start); f =3D fittype('a*x^b+c','options',s); [coe,gof] =3D fit(xx,yy,f); coe gof plot(coe,'r'); grid on; the fitting result is not satisfied=EF=BC=9A General model: coe(x) =3D a*x^b+c Coefficients (with 95% confidence bounds): a =3D 2.035 (-6885, 6889) b =3D 4.595 (-1139, 1148) c =3D 1.006 (-8.515e+07, 8.515e+07) gof =3D sse: 2.6959e+17 rsquare: -0.1105 dfe: 17 adjrsquare: -0.2411 rmse: 1.2593e+08 Then I use the curve fitting tool in matlab toolbox to fit the same array. The result is just fine: General model Power2: f(x) =3D a*x^b+c Coefficients (with 95% confidence bounds): a =3D 5.2e-17 (1.568e-17, 8.832e-17) b =3D 19.19 (18.96, 19.43) c =3D 0 (-6.271e+05, 6.271e+05) Goodness of fit: SSE: 2.398e+13 R-square: 0.9999 Adjusted R-square: 0.9999 RMSE: 1.188e+06 I guss the problem comes from the StartPoint setting, because when I set the StartPoint as [5.2e-17 19.19 0], my program can also get a fine result. Here are the source code ge...

another matlab to C++ question
Just wondering if there is a way to set up a wait for object in C++ and then when an event completes in MatLab have data from MatLab pushed to C++ (start the C++ thread)? thanks Paul. On 2 Des, 17:24, "Paul Gordon" <paul.m.gor...@navy.mil> wrote: > Just wondering if there is a way to set up a wait for object in C++ and then when an event completes in MatLab have data from MatLab pushed to C++ (start the C++ thread)? Probably not easy, maybe very tricky indeed. Interoperability like that requires very careful design towards that prupose. I suspect matlab is not prepared for that kind of thing, and pulling this off from the C++ side probably requires specialized skills in server programming. Rune Rune Allnor <allnor@tele.ntnu.no> wrote in message <321c75f2-b8bd-47ee-9eab-3fe306360e1d@t16g2000vba.googlegroups.com>... > On 2 Des, 17:24, "Paul Gordon" <paul.m.gor...@navy.mil> wrote: > > Just wondering if there is a way to set up a wait for object in C++ and then when an event completes in MatLab have data from MatLab pushed to C++ (start the C++ thread)? > > Probably not easy, maybe very tricky indeed. > > Interoperability like that requires very > careful design towards that prupose. > I suspect matlab is not prepared for > that kind of thing, and pulling this > off from the C++ side probably requires > specialized skills in server programming. > > Rune Ok thanks for the information...

Matlab ARMA Forecast Question
Hello, I am confused when using predict() function, when I try to use ARMA to forecast. Assume I have an ARMA model(3,3), and I want to predict the following data series for 1 step ahead: data=[1;2;3;4] so when I use output=predict(arma_model, data, 1); what is the output data?? I think because this is a (3,3) ARMA model, so ARMA model will take the first three number in the data series (1,2,3) as input to forecast the forth number, am I right? I think there only would be 1 number outputed, but why I could get 4 numbers output, which I think I could only get 1 numbers. PREDICT calculates the forecasted values over the time span covered by the provided measured data. It does not forecast beyond the available data range. For that, you can use the forecast function I posed some time ago; see: http://www.mathworks.com/matlabcentral/answers/12186-forecasting-function rajiv "LEI Zhang" <sesime@gmail.com> wrote in message news:j3j0d3$p45$1@newscl01ah.mathworks.com... > Hello, I am confused when using predict() function, when I try to use ARMA > to forecast. > > Assume I have an ARMA model(3,3), and I want to predict the following data > series for 1 step ahead: > > data=[1;2;3;4] > > so when I use > > output=predict(arma_model, data, 1); > > what is the output data?? > > I think because this is a (3,3) ARMA model, so ARMA model will take the > first three number in the data series (1,2,...

matlab vectorized multiplication question
Hello everyone, I have a matrix say 'A' of size 100x3 and a row vector 'B' of size 100x1 vector. What I want to do is element wise multiply each of the column vector in A with the vector B which should give me a 100x3 matrix. Is there a way to do this in one statement where I do not also have to loop over 1:3 (the column dimensions). Many thanks for any help you can give me. Luca Luca <luca.pamparana@gmail.com> wrote in message <c8754659-54e2-4e10-82dd-48a6a76f8b0f@f36g2000vbm.googlegroups.com>... > Hello everyone, > > I have a matrix say 'A' of size 100x3 and a row vector 'B' of size > 100x1 vector. What I want to do is element wise multiply each of the > column vector in A with the vector B which should give me a 100x3 > matrix. > > Is there a way to do this in one statement where I do not also have to > loop over 1:3 (the column dimensions). ====================== You can do bsxfun(@times,A,B) but I wouldn't be surprised if the for-loop is faster, given the small size of the loop. On Oct 30, 4:21=A0pm, "Matt J " <mattjacREM...@THISieee.spam> wrote: > Luca <luca.pampar...@gmail.com> wrote in message <c8754659-54e2-4e10-82dd= -48a6a76f8...@f36g2000vbm.googlegroups.com>... > > Hello everyone, > > > I have a matrix say 'A' of size 100x3 and a row vector 'B' of size > > 100x1 vector. What I want to do is element wi...

Some basic questions about MATLAB operation
Hi, I have recently started using MATLAB for a DSP and a Communication Theory class. I have some questions about how MATLAB does some things. 1. To plot a graph, say a sinusoid, I always do this: t=0:.1:10; a=sin(t); plot(t,a) What does MATLAB do to generate the data for the points that are not in increments of .1? for example sin(1.13)? Does it interpolate to generate the graph? Is this sinusoid only valid for .1 increments? In fact, a function in MATLAB is inherently discrete, but we use it to model continuous functions (its 'domain' is actually only 101 samples)? 2. I'm having trouble mixing up the indices of the array (1..101 for t matrix) and the actual values (t(1)=0 t(1)=0.1, etc.)I am doing a lot of shifting of functions (such as f(x) = x -> f(x-2) = x-2) and this is messing me up, I usually get the error, "indices must be positive or logicals.." Mathematically, it makes sense to compute f(x(1)-2) for x(1)=1, but it doesn't make sense in MATLAB to ask for f(-1). This brings me to the question of what is a reasonable matrix size for x. -100:.1:100 ? Does it depend on the precision you need? Is there a 'convention' used to model functions? 3. I had a misconception that MATLAB was very close to mathematical notation. In fact, you have to interpret a lot when using it, often going back to the theory to make sure computations make sense. So am I using it the 'right' way. Usually only crunching huge amounts of numbers? I know...

Web resources about - Few matlab questions - comp.soft-sys.matlab

West Lothian question - Wikipedia, the free encyclopedia
He illustrated his point by pointing out the absurdity of a Member of Parliament for West Lothian being able to vote on matters affecting the ...

To daylight save or not to daylight save? That is the question
Australians are perfectly happy to shrug over boring, vital issues &ndash; but force our free citizenry to occasionally adjust their clocks? ...

To SQL or NoSQL? That’s the database question
It's a tangled, database web out there. (credit: Getty Images) Poke around the infrastructure of any startup website or mobile app these days, ...

Question of the Day: Coolest engine-displacement badge ever?
Filed under: Etc. , Automotive History During the engine-displacement arms race, car companies vied for the raciest-looking numerical badges. ...

Yahoo!: SunTrust to Host Call with Proxy Advisory Group on Starboard Questions
SunTrust Robinson Humphrey ’s Robert Peck , who has beaten the drum louder than anyone else on the Street about the lack of responsiveness of ...

Apple responds to FBI iPhone hack, but questions remain
Yesterday, the FBI announced that it had managed to break into the San Bernardino shooter's iPhone sans help from Apple. The iPhone manufacturer ...

4 Questions That Unlock Brand Potential
It’s difficult to escape the pervasive influence that brands have on our lives. In the broadest sense, brands constitute the organizing mechanism ...

A Student’s Question About the Minimum Wage
(Don Boudreaux) Tweet Last night in my Principles of Microeconomics class at George Mason University (ECON 103) my students and I discussed ...

​The 10 oddest job interview questions
On your toes, applicants: What's your game plan if you find a penguin in the freezer?

Nearly retired? 3 questions to ask
No matter what happens to the markets, retirees should ask these three key questions to keep money safe, say financial advisors.

Resources last updated: 3/30/2016 7:10:07 PM