https://jp.mathworks.com/matlabcentral/newsreader/most_recent_feed
MATLAB Central Newsreader Recent Posts
Most Recent Posts
enus
©19942017 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
https://jp.mathworks.com/images/membrane_icon.gif

Thu, 17 Aug 2017 10:46:09 +0000
Re: Perron eigenvector
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/282898#955897
chintu gurbani
"d" wrote in message <htbq5q$3ka$1@fred.mathworks.com>...<br>
> hi, <br>
> Is there's a matlab function that calculates the Perron vector of a matrix ?<br>
> (the eigenvector that corresponds to the "Perron root" or the "Perron–Frobenius eigenvalue") ? <br>
> <br>
> thank you, <br>
> D<br>
I have designed an estimator that can give perron vector of a matrix. gama represent the perron vector. D_matrix generates a row stochastic matrix, the function code of which is mentioned below. <br>
<br>
clc<br>
clear all <br>
<br>
n=4;<br>
I=eye(n,n);<br>
gama(:,:,1)=I;<br>
P(:,:,1)=D_Matrix( n)<br>
for i=1:2<br>
P(:,:,i+1)=D_Matrix( n)*P(:,:,i);<br>
for j=1:20<br>
gama(:,:,j+1)=P(:,:,i+1)*gama(:,:,j);<br>
end<br>
<br>
<br>
end<br>
[RV1, EV1, LV1]=eig(P(:,:,1));<br>
[RV, EV, LV]=eig(P(:,:,i+1));<br>
<br>
function [ D ] = D_Matrix( n)<br>
for i=1:n<br>
for j=1:n<br>
D(i,j)=floor(n*rand);<br>
end<br>
D(i,:)=D(i,:)/sum(D(i,:));<br>
end<br>
<br>
end<br>
<br>
Reference: Cooperative control with distributed gain adaptation and<br>
connectivity estimation for directed networksâ€ˇ<br>

Thu, 17 Aug 2017 10:33:46 +0000
Re: Save workspace from function batch job
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349272#955896
Edric M Ellis
"Jeroen M." <j.p.meijler@student.tudelft.nl> writes:<br>
<br>
> I am currently building a model that makes use of the batch function, as the<br>
> model is getting quite extensive and I want to run it on a highperformance<br>
> cluster. <br>
><br>
> For this I am using the following code:<br>
><br>
> Load_workspace;<br>
> clust = parcluster('local');<br>
> N=4;<br>
> job = batch(clust, @Do_All, 0, 'Pool', N1);<br>
><br>
> Although this does indeed run, I do not know where to get the output from. The<br>
> output is one of the variables in the workspace, which is updated by the<br>
> function Do_All. Using load(job) doesn't work, as it is no script, and data =<br>
> fetchOutputs(job) results in a 1x0 cell.<br>
<br>
The argument to BATCH that follows the function specifies how many<br>
outputs you wish to request from that function. So, in your case, if<br>
"Do_All" returns 3 outputs, you'd say:<br>
<br>
job = batch(clust, @Do_All, 3, 'Pool', N1);<br>
wait(job); fetchOutputs(job)<br>
<br>
Cheers,<br>
Edric.

Thu, 17 Aug 2017 06:32:24 +0000
Re: how to addpath for image using GUI interface
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349337#955895
Nasser M. Abbasi
On 8/17/2017 1:24 AM, Muhammad RSMY wrote:<br>
<br>
> one more question please<br>
> <br>
> the image_name='image.png'<br>
> <br>
> when I code it to be input from GUI<br>
> strImage_name=get(handles.Image_name,'string');<br>
> image_name=str2double(strImage_name);<br>
> <br>
> while running GUI I get image_name as NaN<br>
> <br>
<br>
Why are you using str2double(strImage_name)? Since you<br>
read the image name as string. Why you are converting the string<br>
to double? Try without this conversion.<br>
<br>
Check this answer for examples<br>
<br>
https://www.mathworks.com/matlabcentral/answers/43212howtogetthevalueoftheedittextbox<br>
<br>
Nasser

Thu, 17 Aug 2017 06:24:10 +0000
Re: how to addpath for image using GUI interface
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349337#955894
Muhammad RSMY
"Muhammad RSMY" wrote in message <on3b25$t8c$1@newscl01ah.mathworks.com>...<br>
> "Nasser M. Abbasi" wrote in message <on2pe6$1sur$1@gioia.aioe.org>...<br>
> > On 8/16/2017 7:47 PM, Muhammad RSMY wrote:<br>
> > > dear friends<br>
> > > <br>
> > > as being new user for matlab.. I built an interface for my code in which I need to add path for the image in other words the location where those images are<br>
> > > <br>
> > > in my code: addpath('C:\images')<br>
> > > <br>
> > > now I am using interface but don't know how to let the user input the path using interface and <br>
> > >that path should transport to my code and run<br>
> > > <br>
> > > I hope someone help me as soon as possible<br>
> > > <br>
> > > Thanks<br>
> > > <br>
> > <br>
> > You can use uigetdir() to let use select the folder. Once<br>
> > the user selects the folder, and the folder name is now<br>
> > saved in some variable, you can then in the code issue<br>
> > the command<br>
> > <br>
> > addpath(folder_name_selected_by_user);<br>
> > <br>
> > https://www.mathworks.com/help/matlab/ref/uigetdir.html<br>
> > <br>
> > "folder_name = uigetdir displays a modal dialog box showing<br>
> > the folders that are inside the current working directory.<br>
> > This dialog allows you to navigate to a folder and select it"<br>
> <br>
> Thanks dear Nasser Abbasi.. your kind response always appreciated<br>
<br>
Dear Nasser<br>
<br>
one more question please<br>
<br>
the image_name='image.png'<br>
<br>
when I code it to be input from GUI <br>
strImage_name=get(handles.Image_name,'string');<br>
image_name=str2double(strImage_name);<br>
<br>
while running GUI I get image_name as NaN<br>
<br>
can you please help.. thanks so much

Thu, 17 Aug 2017 05:54:13 +0000
Re: how to addpath for image using GUI interface
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349337#955893
Muhammad RSMY
"Nasser M. Abbasi" wrote in message <on2pe6$1sur$1@gioia.aioe.org>...<br>
> On 8/16/2017 7:47 PM, Muhammad RSMY wrote:<br>
> > dear friends<br>
> > <br>
> > as being new user for matlab.. I built an interface for my code in which I need to add path for the image in other words the location where those images are<br>
> > <br>
> > in my code: addpath('C:\images')<br>
> > <br>
> > now I am using interface but don't know how to let the user input the path using interface and <br>
> >that path should transport to my code and run<br>
> > <br>
> > I hope someone help me as soon as possible<br>
> > <br>
> > Thanks<br>
> > <br>
> <br>
> You can use uigetdir() to let use select the folder. Once<br>
> the user selects the folder, and the folder name is now<br>
> saved in some variable, you can then in the code issue<br>
> the command<br>
> <br>
> addpath(folder_name_selected_by_user);<br>
> <br>
> https://www.mathworks.com/help/matlab/ref/uigetdir.html<br>
> <br>
> "folder_name = uigetdir displays a modal dialog box showing<br>
> the folders that are inside the current working directory.<br>
> This dialog allows you to navigate to a folder and select it"<br>
<br>
Thanks dear Nasser Abbasi.. your kind response always appreciated

Thu, 17 Aug 2017 02:02:16 +0000
Raster
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349338#955892
Samuel Silva
I have two neurons (model HH created in NEURON), with the time and voltage files of each one saved and I want to plot the spike raster of them. What is the simplest way to do this?

Thu, 17 Aug 2017 00:53:22 +0000
Re: how to addpath for image using GUI interface
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349337#955891
Nasser M. Abbasi
On 8/16/2017 7:47 PM, Muhammad RSMY wrote:<br>
> dear friends<br>
> <br>
> as being new user for matlab.. I built an interface for my code in which I need to add path for the image in other words the location where those images are<br>
> <br>
> in my code: addpath('C:\images')<br>
> <br>
> now I am using interface but don't know how to let the user input the path using interface and <br>
>that path should transport to my code and run<br>
> <br>
> I hope someone help me as soon as possible<br>
> <br>
> Thanks<br>
> <br>
<br>
You can use uigetdir() to let use select the folder. Once<br>
the user selects the folder, and the folder name is now<br>
saved in some variable, you can then in the code issue<br>
the command<br>
<br>
addpath(folder_name_selected_by_user);<br>
<br>
https://www.mathworks.com/help/matlab/ref/uigetdir.html<br>
<br>
"folder_name = uigetdir displays a modal dialog box showing<br>
the folders that are inside the current working directory.<br>
This dialog allows you to navigate to a folder and select it"

Thu, 17 Aug 2017 00:47:11 +0000
how to addpath for image using GUI interface
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349337#955890
Muhammad RSMY
dear friends<br>
<br>
as being new user for matlab.. I built an interface for my code in which I need to add path for the image in other words the location where those images are<br>
<br>
in my code: addpath('C:\images')<br>
<br>
now I am using interface but don't know how to let the user input the path using interface and that path should transport to my code and run<br>
<br>
I hope someone help me as soon as possible <br>
<br>
Thanks

Wed, 16 Aug 2017 23:49:08 +0000
polyphase sin wave or polyphase DDS
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349336#955889
s002 wjh
i'm try to generate 400mhz sin wave in hardware, but my wave generator DDS can only go upto 100mhz. I heard i can put 4x in parallel and adjust its phase, then combine each DDS output and create a 400mhz wave (so dds1(0), dds2(0), dds3(0), dds4(0), would be 400mhz sample 1,...4)<br>
<br>
anyone know how do i do that in matlab?<br>
eg. if x=cos(2pi*100e6*n), how do i convert this signal 4 time in parallel, then combine into 400mhz signal?

Wed, 16 Aug 2017 18:03:09 +0000
Re: 2D Fourier Matrix
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/252244#955888
Bjorn Gustavsson
"Oren" wrote in message <on1r0g$he2$1@newscl01ah.mathworks.com>...<br>
> "Chao Huang" wrote in message <jieb1b$60l$1@newscl01ah.mathworks.com>...<br>
> > Gonsolo <gonsolo@gmail.com> wrote in message <b29975bbf23b489db95d7f194396cb7b@j12g2000vbl.googlegroups.com>...<br>
> > > I can generate a Fourier matrix with dftmtx( N ).<br>
> > > Also, I can generate a dct matrix with dct( eye( N ) ).<br>
> > > <br>
> > > Is there a way to build a matrix for dct2?<br>
> > > Unfortunately dct( dct( eye( N )' ) doesn't work.<br>
> > > <br>
> > > I tried multidimensional matrices but operator * isn't defined for<br>
> > > them.<br>
> > > <br>
> > > Any ideas?<br>
> > <br>
> > Say A is a M by N matrix (M rows, N columns), then<br>
> > <br>
> > fft2(A) = dftmtx(M) * A * dftmtx(N)<br>
> > <br>
> > Cheers<br>
> <br>
> Hi, I noticed that (using your syntax) dftmtx(M) * A * dftmtx(N)  fft2(A) !=0. There is some numerical error there. Any idea why?? the mathematical operation should be exactly the same to the best of my knowledge.<br>
> <br>
> Oren<br>
><br>
The numerical operations are most certainly not exactly the same, the matrixversion uses matlab's matrix multiplication operations, while the fftcall uses the recursive fftw fastFouriertransform implementation (last time I checked). So roundinglevel differences are to be expected.

Wed, 16 Aug 2017 17:44:23 +0000
Re: combine array
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/349335#955887
Nasser M. Abbasi
On 8/16/2017 9:56 AM, s002 wjh wrote:<br>
> whats a easy way to combine array into one.<br>
> eg<br>
> <br>
> a=[1,2,3,4]; b=[7,8,9,10]<br>
> <br>
> I want interleave like this<br>
> c=[1,7,2,8,3,9,4,10]<br>
> <br>
<br>
C=[a;b];<br>
C(:)'<br>
<br>
1 7 2 8 3 9 4 10<br>
<br>
<br>
Nasser

Wed, 16 Aug 2017 17:16:48 +0000
Re: sort (file)names in numeric order
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/254812#955886
Doug Schwarz
In article <omumd2$c9p$1@newscl01ah.mathworks.com>,<br>
"Asma Abbasi" <asma.mscs758@iiu.edu.pk> wrote:<br>
<br>
> Hi, I want to sort images in natural order. But nat_sort doesn't work. Can <br>
> anyone help? Thanks<br>
<br>
There are two similar files in the FEX, natsort from Stephen Cobeldick <br>
and my own sort_nat. Which one did you try and what went wrong?<br>
<br>
 <br>
Doug Schwarz<br>
dmschwarz&ieee,org<br>
Make obvious changes to get real email address.

Wed, 16 Aug 2017 16:14:09 +0000
Re: 2D Fourier Matrix
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/252244#955885
Oren
"Chao Huang" wrote in message <jieb1b$60l$1@newscl01ah.mathworks.com>...<br>
> Gonsolo <gonsolo@gmail.com> wrote in message <b29975bbf23b489db95d7f194396cb7b@j12g2000vbl.googlegroups.com>...<br>
> > I can generate a Fourier matrix with dftmtx( N ).<br>
> > Also, I can generate a dct matrix with dct( eye( N ) ).<br>
> > <br>
> > Is there a way to build a matrix for dct2?<br>
> > Unfortunately dct( dct( eye( N )' ) doesn't work.<br>
> > <br>
> > I tried multidimensional matrices but operator * isn't defined for<br>
> > them.<br>
> > <br>
> > Any ideas?<br>
> <br>
> Say A is a M by N matrix (M rows, N columns), then<br>
> <br>
> fft2(A) = dftmtx(M) * A * dftmtx(N)<br>
> <br>
> Cheers<br>
<br>
Hi, I noticed that (using your syntax) dftmtx(M) * A * dftmtx(N)  fft2(A) !=0. There is some numerical error there. Any idea why?? the mathematical operation should be exactly the same to the best of my knowledge.<br>
<br>
Oren

Wed, 16 Aug 2017 16:00:27 +0000
Re: Super resolution warp/transformtion matrix
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/137152#955884
Abhishek kumar
"fas" <faisalmufti@gmail.com> wrote in message <1165136702.869962.43240@j44g2000cwa.googlegroups.com>...<br>
> Hi<br>
> I am able to find homography between two images, as (3x3) matrix<br>
> however, using the super resolution model where Y=DHX here H is the<br>
> warp/transformation matrix is of size L^2xL^2 where L is the size of HR<br>
> image. I have been trying hard how to build this sparse matrix H from<br>
> my homography.<br>
> Anyone please suggest some solution.<br>
> Thanks.<br>
> <br>
I have the same problem . Can you help me ..

Wed, 16 Aug 2017 15:46:08 +0000
Re: Decimation Matrix
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/137370#955883
Abhishek kumar
"fas" <faisalmufti@gmail.com> wrote in message <1165551120.915189.267200@79g2000cws.googlegroups.com>...<br>
> Thanks Roger, but reason for me doing this is because I want to<br>
> implment the Super resolution image model in which Y=DFCX , where D is<br>
> decimation, C is blurring, F is warping and Y and X are low and high<br>
> resolution images. So in this context I want to construct the<br>
> decimation matrix( although it would be sparse). What do you say then ?<br>
> fas wrote:<br>
> > Hi I have been trying to construc a decimation matrix for a vectorize<br>
> > image. I beleive theoratically I am correct, but I am not getting the<br>
> > right result , e.g to Decimate an image of size 4x4 into 2x2 I think I<br>
> > should have a decimation matrix as<br>
> > Dec=[1100110000000000<br>
> > 0011001100000000<br>
> > 0000000011001100<br>
> > 0000000000110011];<br>
> > Then I do Image=Dec*im(:); where im=4x4,<br>
> > If I use the same format for bigger image, and view my Image it turns<br>
> > out to be to image of half the size instead of one image of half the<br>
> > size, I do not know what is worng ?. Can anyone help ???<br>
> > Thanks.,<br>
> <br>
<br>
<br>
I also have question how to find the other two matrices..i.e. blur matrix and warp matrix