Sign in

username or email:

password:



Not a member?
Forgot your password?

Search matlab



Search tips

Subscribe to matlab



Ads

Discussion Groups

See Also

Embedded SystemsFPGA

Discussion Groups | Matlab DSP | covariance matrices with cov()

hi,i'm trying to verify some other code i've written in c for calculating the covariance of 2 nxm matrices (n points in m dimensions (i.e...

  

Post a new Thread



Is this thread worth a thumbs up?

0

covariance matrices with cov() - Juan Vesa - Aug 16 10:40:30 2010

hi,
i'm trying to verify some other code i've written in c for  
calculating the covariance of 2 nxm matrices (n points in m  
dimensions (i.e. 3)) using matlabs cov() command,
when i calculate say cov(a), the resulting matrix is mxm matrix and i  
verify that my results are the same as matlabs,
but calculating the cov(a,b) of two different matrices or even cov(a,  
a) of the same matrix i get an (m-1)x(m-1) matrix back and i'm  
stumped as to the results,
could someone be so kind as to explain matlabs result to me?
regards,
______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

getting frames continuously from a figure ? - Tolga_Özkurt - Aug 17 8:40:31 2010

Hi folks,

I got stuck in this problem: I have a figure and throughout my script, the 
figure is being changed. How can I capture all changes in the figure (sample it)

and make them an animation (gif or avi formatted), as if the Matlab function 
"getframe" works continuously?

Cheers,

Tolga
      
______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: getting frames continuously from a figure ? - Tilak Rajesh - Aug 18 14:05:22 2010

Hej Tolga !

I think, you can save all the figure as images in your code.
saveas(gcf,['./Saved_Figure_',num2str(n),'_position.png'])

Then, read those images and save as movie.
clear all; close all; clc

for n=1:54
   eval(['x=imread(''./Saved_Figure_',num2str(n),'_position.png'');'])
   M(n)=im2frame(x);
end
[h, w, p] = size(M(1).cdata);  % use 1st frame to get dimension
hf = figure;
% resize figure based on frame's w x h, and place at (150, 150)
set(hf, 'position', [120 120 w h]);
axis off
% tell movie command to place frames at bottom left
movie(hf,M,1,3,[0 0 0 0]);
movie2avi(M,'filename','fps',3)

As to what these commands do, better read the MATLAB help docs.
Good Luck.

Cheers,
Tilak

2010/8/16 Tolga Ă–zkurt <t...@yahoo.com>

> Hi folks,
>
> I got stuck in this problem: I have a figure and throughout my script, the
> figure is being changed. How can I capture all changes in the figure
(sample
> it) and make them an animation (gif or avi formatted), as if the Matlab
> function "getframe" works continuously?
>
> Cheers,
>
> Tolga
>
>  
>

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )