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

Tue, 07 Jul 2015 08:04:04 +0000
Re: Step By Step simulation forward and rewind.
http://feedproxy.google.com/~r/mathworks/zAHF/~3/3TVcZNIwz0Q/341714
Prabhakaran thirugnanam
"Prabhakaran thirugnanam" <tpkaran1985@yahoo.com> wrote in message <mnehdf$8v0$1@newscl01ah.mathworks.com>...<br>
> While Simulating a simulink model step by step, If I do rewind operation (i.e. similar to step by step forward , If I click rewind ) will it undo the changes made in the base workspace as well. I mean In the current step I udated base workspace using To Workspace block. If I click rewind by one step, Will it undo the change in my baseworkspace?<br>
<br>
<br>
<br>
Reply:<br>
It works. It updates the base workspace as well. It undo the changes made in the base workspace. However I tried with simple from workspace & To worksapce blocks. NOt sure about the complex systems which involves feedback, and loops....<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/3TVcZNIwz0Q" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341714#936396

Tue, 07 Jul 2015 07:25:03 +0000
Re: How do I make an image appear as though it was seen with visible light?
http://feedproxy.google.com/~r/mathworks/zAHF/~3/qCmDdh1Mqw/341717
Bjorn Gustavsson
"Mission:Tall" wrote in message <mnethj$6ei$1@newscl01ah.mathworks.com>...<br>
> I have an image and it is a picture of a cell that was taken by some means other than visible light and the goal is to transform the image into an image that appears as though it was taken with light with a wavelength of 530 nm. Please help I have no idea even where to start.<br>
<br>
If I understand you right you have a grayscale image (only one colour channel) of your cell?<br>
<br>
Then to display that as if it was at 530 nm, you'd simply put that image into a RGBimage's green field:<br>
<br>
% Blue field, preallocation:<br>
yourRGBimage(:,:,3) = 0*yourGRAYimage; % Blue field, preallocation<br>
% Green component scaled 01:<br>
yourRGBimage(:,:,2) = yourGRAYimage/max(yourGRAYimage(:));<br>
% If you want some "exact" perception matching you might add some red to that...<br>
yourRGBimage(:,:,1) = CofChoice*yourGRAYimage/max(yourGRAYimage(:));<br>
<br>
HTH<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/qCmDdh1Mqw" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341717#936395

Tue, 07 Jul 2015 07:20:03 +0000
Re: Analyzing Accelerometer Data.
http://feedproxy.google.com/~r/mathworks/zAHF/~3/mPXqFItw9xo/259740
M.Noorazlan Shah Zainudin
vbpaixao <vbpaixao@gmail.com> wrote in message <9f3e6328361d4e88a87992e7ab655bfa@i9g2000yqk.googlegroups.com>...<br>
> On Aug 25, 2:00 pm, "Fernando Ginez da Silva" <fgi...@gmail.com><br>
> wrote:<br>
> > TideMan <mul...@gmail.com> wrote in message <d2097e35e9834cd0ac8864bd946e2...@z12g2000yqj.googlegroups.com>...<br>
> > > On Jul 5, 11:04 am, "Angel " <angel...@gmail.com> wrote:<br>
> > > > Hello<br>
> ><br>
> > > > I am working with a project with 3d accelerometers as well and after taking some measurements today we saw something regarding the use of the Fourier transformation.<br>
> ><br>
> > > > The FFT will yield you nice results when the signal you have is or was composed of several signals of different frecuencies. So you'll see the magnitude of the diff frecuencies that form the signal. However, with a regular motion (assuming it is) there will be a single frecuency or almost only one. So for classification doesn't serve the purpose in my opinion, but for audio signals is really useful.<br>
> ><br>
> > > > Hope this helps<br>
> ><br>
> > > > Faizi <khan.ram...@gmail.com> wrote in message <eeed6a853c8a4e2a8b137bc3cadc9...@m20g2000vbp.googlegroups.com>...<br>
> > > > > Hello all,<br>
> ><br>
> > > > > I am a student, and I am trying to work with accelerometer data. I<br>
> > > > > mounted the accelerometer at the waist and logged walking, running and<br>
> > > > > jump while running in a single log file. Now I am plotting the<br>
> > > > > acceleration vs time. But I am not able to figure out some very<br>
> > > > > meaningful conclusions out of it.<br>
> ><br>
> > > > > Data from the accelerometer is available as a log file which gives<br>
> > > > > Time, AccX,AccY,AccZ. I am using just one axis for the sensor to<br>
> > > > > analyze the movement pattern.<br>
> ><br>
> > > > > What I am doing is:<br>
> ><br>
> > > > > time=file_load(:,1)<br>
> > > > > acc=file_load(:,2)<br>
> > > > > stem(time,acc)<br>
> ><br>
> > > > > I do see, some patterns, but I would like to have suggestion, how the<br>
> > > > > fourier analysis of such data that could be helpful to classify the<br>
> > > > > movements, I am open to any help, suggestions and guidance.<br>
> ><br>
> > > > > Kind regards.<br>
> ><br>
> > > By taking the FFT, you are removing all dependence on time.<br>
> > > Heisenberg Uncertainty Principle (paraphrased):<br>
> > > For a signal in the time domain, you must accept vagueness in<br>
> > > frequency; and<br>
> > > for a signal in the frequency domain, you must accept vagueness in<br>
> > > time.<br>
> ><br>
> > In my opinion, to perform a signal classification, you need to extract "features" from those signals.<br>
> ><br>
> > These "features" can be:<br>
> >  main frequency (using FFT)<br>
> >  max. magnetude (using FFT)<br>
> >  mean<br>
> >  standard deviation<br>
> >  correlation between axes<br>
> >  etc...<br>
> ><br>
> > It's expected to obtain feature sets with similar values within the same classification group.<br>
> ><br>
> > Using these sets you can try some computational intelligence tool to perform classification, sush as neural network or a fuzzy system.<br>
> <br>
> I use accelerometer data to obtain unsupervised classification.<br>
> After preprocessing I divide data in 50% overlapping windows and<br>
> extract features from each window (some of the features I can later<br>
> remove if they prove somewhat redundant):<br>
> mean<br>
> std<br>
> total acceleration (sqrt(x^2+y^2+z^2)<br>
> max+std<br>
> spectral power (minus the dc component since it's already included in<br>
> total accel)<br>
> spectral entropy (DC component)<br>
> <br>
> Perform a PCA on the feature matrix and after that the classification.<br>
> I use SOM and kmeans which is goog for unsupervised.<br>
> But other methods may be used of course.<br>
> <br>
> Hope this helps<br>
<br>
hello and very good day.<br>
<br>
I am also dealing with the accelerometer data. May I ask the sample matlab code from u?<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/mPXqFItw9xo" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/259740#936394

Tue, 07 Jul 2015 06:51:03 +0000
Add Folders to Installation Directory [deploytool]
http://feedproxy.google.com/~r/mathworks/zAHF/~3/EHpemtS34iE/341721
Bilgehan paray
I'm trying to deploy my application using deploytool.<br>
I need some folders and mat files to be installed with the application. There is a section 'Files installed for your end user' doing this but adding folders doesn't create folders in installation directory, instead it copies everything inside the folders to the directory. How can keep the folder hierarchy when adding files to installer?<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/EHpemtS34iE" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341721#936393

Tue, 07 Jul 2015 05:22:03 +0000
IPFC OPTIMAL PLACEMENT
http://feedproxy.google.com/~r/mathworks/zAHF/~3/m2AE24dyCto/341720
Joel Sutter
I am requesting you guys to give me a code for optimal placement of IPFC FACTS<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/m2AE24dyCto" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341720#936392

Tue, 07 Jul 2015 00:48:03 +0000
Re: Matlab and binary files  jasco .jws data importer
http://feedproxy.google.com/~r/mathworks/zAHF/~3/hk6RvTSrYjU/142324
Matias Insausti
Snoopy <snoopy@mailinator.com> wrote in message <ef4ee10.1@webcrossing.raydaftYaTP>...<br>
> Does anyone know of a way to import Jasco Spectra Manager .jws data<br>
> files into Matlab? The files appear to be in a binary format. The<br>
> import isn't straightforward (to me anyway). I have over a hundred<br>
> fluorescence spectra datasets in the .jws format. The only way I<br>
> know of to get them into MATLAB is to convert each one into ASCII in<br>
> the Jasco Spectra Manager seperately. I would hope that someone out<br>
> there has a more direct way to import them into MATLAB...<br>
<br>
Hi, I could solve this problem, using de free download program CCA+ to save all spectra in only one file .dat.<br>
Then I erase the first highlines and use the command:<br>
<br>
<br>
N = 12200;<br>
formatSpec = '%f %s';<br>
fileID = fopen(E(i,:));<br>
C = textscan(fileID,formatSpec,N,'CommentStyle','[Matias#','Delimiter',' ');<br>
<br>
<br>
My data was something like this (12200 variables, 60 spectra of 200 wavelenghts for each sample):<br>
<br>
[Matias#111_001]<br>
480.000000 8.908922e+001<br>
479.000000 8.832694e+001<br>
478.000000 8.862214e+001<br>
477.000000 8.797721e+001<br>
476.000000 8.782946e+001<br>
475.000000 8.699937e+001<br>
474.000000 8.634059e+001<br>
473.000000 8.565611e+001<br>
472.000000 8.407620e+001<br>
471.000000 8.391961e+001<br>
470.000000 8.336167e+001<br>
<br>
<br>
[Matias#111_002]<br>
480.000000 8.776386e+001<br>
479.000000 8.690283e+001<br>
478.000000 8.634786e+001<br>
477.000000 8.683386e+001<br>
476.000000 8.688203e+001<br>
475.000000 8.599710e+001<br>
474.000000 8.559185e+001<br>
473.000000 8.482065e+001<br>
472.000000 8.424711e+001<br>
471.000000 8.308449e+001<br>
470.000000 8.287491e+001<br>
469.000000 8.236522e+001<br>
<br>
<br>
<br>
then you use the data in the cell:<br>
<br>
EE=[];<br>
for ii=1:12200;<br>
EE(ii)=str2num(C{1,2}{ii,1});<br>
end<br>
EEa=[];<br>
for iii=0:60;<br>
EEa=[EEa EE((iii*200)+21:(iii*200)+200)];<br>
end<br>
EET(i,:)=EEa;<br>
end<br>
<br>
<br>
I hope this can help you<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/hk6RvTSrYjU" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/142324#936391

Tue, 07 Jul 2015 00:25:03 +0000
Re: How do I insert variable into function?
http://feedproxy.google.com/~r/mathworks/zAHF/~3/vwWxc9wiz_4/341718
triberk
"dpb" wrote in message <mnf4jr$rss$1@dontemail.me>...<br>
> On 07/06/2015 5:23 PM, triberk wrote:<br>
> ...<br>
> <br>
> > str = input('Enter the cutoff frequencies for first signal: ', 's');<br>
> > valparts = regexp(str, '[ ,]', 'split');<br>
> > values = str2double(valparts);<br>
> > des=fdesign.bandpass('n,F3dB1,F3dB2', 6, 'valparts(1)', 'valparts(2)',<br>
> > 100);<br>
> ...<br>
> <br>
> > I am trying to insert valparts(1) and valparts(2) into bandpass filter<br>
> > as two cutoff frequencies of it, however the values are not recognized<br>
> > by Matlab whilst running the script.<br>
> <br>
> You're passing the character strings, _not_ the values.<br>
> <br>
> You really want values; the input strings converted to the numeric <br>
> values, not valparts the strings, anyway...<br>
> <br>
> des=fdesign.bandpass('n,F3dB1,F3dB2', 6, values(1), values2), 100);<br>
> <br>
> should work just fine...<br>
> <br>
> Just as an implementation detail, I'd probably use a variable of <br>
> meaningful name not just a generic array like "values" but that's purely <br>
> style, nothing to do with your problem.<br>
> <br>
> <br>
> <br>
> <br>
<br>
Oh, silly me. Always cross mountains and stumble over molehills. Anyway, thanks a lot!<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/vwWxc9wiz_4" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341718#936390

Mon, 06 Jul 2015 23:58:05 +0000
Re: How do I insert variable into function?
http://feedproxy.google.com/~r/mathworks/zAHF/~3/CDyXRnmULSk/341718
dpb
On 07/06/2015 5:23 PM, triberk wrote:<br>
...<br>
<br>
> str = input('Enter the cutoff frequencies for first signal: ', 's');<br>
> valparts = regexp(str, '[ ,]', 'split');<br>
> values = str2double(valparts);<br>
> des=fdesign.bandpass('n,F3dB1,F3dB2', 6, 'valparts(1)', 'valparts(2)',<br>
> 100);<br>
...<br>
<br>
> I am trying to insert valparts(1) and valparts(2) into bandpass filter<br>
> as two cutoff frequencies of it, however the values are not recognized<br>
> by Matlab whilst running the script.<br>
<br>
You're passing the character strings, _not_ the values.<br>
<br>
You really want values; the input strings converted to the numeric <br>
values, not valparts the strings, anyway...<br>
<br>
des=fdesign.bandpass('n,F3dB1,F3dB2', 6, values(1), values2), 100);<br>
<br>
should work just fine...<br>
<br>
Just as an implementation detail, I'd probably use a variable of <br>
meaningful name not just a generic array like "values" but that's purely <br>
style, nothing to do with your problem.<br>
<br>
<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/CDyXRnmULSk" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341718#936389

Mon, 06 Jul 2015 23:16:03 +0000
dicomread shows wrong colors
http://feedproxy.google.com/~r/mathworks/zAHF/~3/_VWfo0wyhB8/341719
Chris Fahim
I'm having issues with dicomread. When I run imshow of the read in dicom the colors are weird, green is what should be black, pink is what should be white. The dicom image is truecolor so I don't think it's a colormap issue. <br>
<br>
Here is the code I use:<br>
info = dicominfo('KX000008');<br>
X = dicomread(info);<br>
imshow(X);<br>
<br>
<br>
X comes out as an 720x960x3 uint8 and the imshow(X) shows an image with a green background which should be black and bright pink which should be white. Any help is appreciated.<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/_VWfo0wyhB8" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341719#936388

Mon, 06 Jul 2015 22:23:03 +0000
How do I insert variable into function?
http://feedproxy.google.com/~r/mathworks/zAHF/~3/joa14bZR0o0/341718
triberk
Hi,<br>
<br>
I am trying to filter a signal within a range that is set by the user by an input, however I can't find a way to insert the input variable into filter function, here's my script:<br>
<br>
str = input('Enter the cutoff frequencies for first signal: ', 's');<br>
valparts = regexp(str, '[ ,]', 'split');<br>
values = str2double(valparts);<br>
des=fdesign.bandpass('n,F3dB1,F3dB2', 6, 'valparts(1)', 'valparts(2)', 100);<br>
Hd=design(des,'butter');<br>
x=filter(Hd,x);<br>
<br>
I am trying to insert valparts(1) and valparts(2) into bandpass filter as two cutoff frequencies of it, however the values are not recognized by Matlab whilst running the script. <br>
<br>
Any help appreciated,<br>
Thanks<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/joa14bZR0o0" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341718#936387

Mon, 06 Jul 2015 21:56:03 +0000
How do I make an image appear as though it was seen with visible light?
http://feedproxy.google.com/~r/mathworks/zAHF/~3/VFY8WQEAj7M/341717
Mission:Tall
I have an image and it is a picture of a cell that was taken by some means other than visible light and the goal is to transform the image into an image that appears as though it was taken with light with a wavelength of 530 nm. Please help I have no idea even where to start.<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/VFY8WQEAj7M" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341717#936386

Mon, 06 Jul 2015 21:32:03 +0000
DCt
http://feedproxy.google.com/~r/mathworks/zAHF/~3/jgCywh7vZc/341716
noorolhoda noorolhoda
hi to every one<br>
<br>
im a bigginer in matlab and i dont know how to make (or show)a dct matrix for two block of my image.(after it i want to quantize the DCTs, and compare them)<br>
i wrote this code.<br>
please tell me how to do it.<br>
thanks alot<br>
<br>
<br>
<br>
MyImage=imread('foreman.bmp','bmp');<br>
foremanYUV=rgb2ycbcr(MyImage);<br>
foreman=foremanYUV(:,:,1);<br>
block1 = foreman(50:57,150:157);<br>
block2 = foreman(160:165,170:175);<br>
imagesc(block2);<br>
imshow(block2);<br>
J = dct2(block2);<br>
imshow(log(abs(J)),[]), colormap(jet(64)), colorbar<br>
size(foreman)<br>
f = dct2(block1);<br>
imshow(log(abs(f)),[]), colormap(jet(64)), colorbar<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/jgCywh7vZc" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341716#936385

Mon, 06 Jul 2015 21:31:03 +0000
problem reading text file
http://feedproxy.google.com/~r/mathworks/zAHF/~3/W7ahNkQYKBQ/341715
Jonathan
Hi,<br>
<br>
I am having a problem reading in a text file of the form:<br>
<br>
Date Time, Water level, Sigma, I, L<br>
20150101 00:00,1.4,0.008,0,0<br>
20150101 01:00,1.5,0.008,0,0<br>
20150101 02:00,1.6,0.008,0,0<br>
<br>
I have tried multiple variations to the following code but so far no luck (keeps coming up with empty cell arrays). <br>
<br>
data = textscan(filename,'%{yyyyMMdd}D %{HH:mm}D %n %n %n %n %*[^\n]','Delimiter',',','EmptyValue',NaN,'headerlines',1);<br>
<br>
I cannot figure out how to input these data. I know that the first column of data has an empty space, while the rest are comma deliminated (I tried even converetd the file so everything was comma delimited but no luck). Any help would be much appreciated...<br>
<br>
Thanks<br>
Jon<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/W7ahNkQYKBQ" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341715#936384

Mon, 06 Jul 2015 18:42:54 +0000
Re: Random Streams for spmd
http://feedproxy.google.com/~r/mathworks/zAHF/~3/kcX2TVyp7KU/341694
Peter Perkins
toms, I believe your problem is that you're getting a (new) copy of s <br>
each time the spmd block executes. Each call to setGlobalStream makes <br>
the appropriate stream the global stream on a worker, but then when you <br>
call randn, it's the _copy_ that's moving ahead. Then the next time the <br>
spmd block executes on that worker, it's using a _new_ copy of the same <br>
stream.<br>
<br>
I think what you want is to set up the global stream on each worker, <br>
once, and then just use randn in your loop, without RandStream.create or <br>
setGlobalStream.<br>
<br>
By the way, it's possible to use a combination of NumStreams and <br>
StreamIndices in the call to RandStream.create to create only the one <br>
stream you need on each worker, that's shown in the help. Of course, <br>
using 'shuffle' will mess that up. The way you currently have it, <br>
creating all four on the client all at once, is the best way to combine <br>
'shiffle'with parallel streams.<br>
<br>
Hope this helps.<br>
<br>
<br>
On 7/3/2015 3:22 AM, toms Seidel wrote:<br>
> Hello!<br>
><br>
> I have a code part whose simplified version looks like this:<br>
><br>
> numlabs = 4;<br>
> [s{1:numlabs}] = RandStream.create('mrg32k3a', 'Seed', 'shuffle',<br>
> 'NumStreams', numlabs);<br>
><br>
> for ii=1:10<br>
> spmd<br>
> % [s{1:numlabs}] = RandStream.create('mrg32k3a', 'Seed',<br>
> 'shuffle', 'NumStreams', numlabs);<br>
> RandStream.setGlobalStream(s{labindex});<br>
> fprintf('Stream %d\n', labindex);<br>
> a = randn(3,1)<br>
> end<br>
> end<br>
><br>
> I would expect that for every worker and for every iteration of the<br>
> outer for loop I get a new new realization for a. However, they seem to<br>
> be the same for every stream. This changes if I comment out line 2 and<br>
> include the RandStream.create statement after the spmd command. However<br>
> I don't fully get why one should use the second form: On every worker I<br>
> create 4 streams but use only one of it.<br>
><br>
> Any help and insights appreciated!<br>
><br>
> Tom<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/kcX2TVyp7KU" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341694#936383

Mon, 06 Jul 2015 18:41:03 +0000
Re: Draw objects by mouse drag
http://feedproxy.google.com/~r/mathworks/zAHF/~3/x09Zkaa_oO0/341669
ghasem
"ghasem" <shaban_sadeghi@yahoo.com> wrote in message <mmvnrm$h8b$1@newscl01ah.mathworks.com>...<br>
> Hi.<br>
> I want to draw different 2d and 3d objects such as cylinder, bticks by mouse drag.<br>
> Namely,first draw a object by drag and then create its corresponding code.<br>
> In fact i want to draw objects similar to paint software.<br>
> Is there anyone who help me?<br>
<br>
Is there someone who help me?<br>
Please give me any information about this topic.<br>
Or,if there is any way to connect matlab with some painting softwares (to draw objects by mouse dragging).<br>
Thank you.<img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/x09Zkaa_oO0" height="1" width="1" alt=""/>
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341669#936382