https://fr.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://fr.mathworks.com/images/membrane_icon.gif

Mon, 27 Mar 2017 12:00:04 +0000
Assignment of Groups and Basic structure to Answer Question (Information on the directionality of tidal currents with existing variables)
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347973#952688
calum Billings
I've been assigned to produce information on the direction of tidal currents with the following available variables: <br>
<br>
Height above sensor. <br>
Time. <br>
Temperature. <br>
Battery.<br>
Heading. <br>
Pitch.<br>
Roll.<br>
Pressure.<br>
Speed. <br>
Direction. <br>
Amplitude. <br>
<br>
I assume I have to use the following time, heading, speed and direction variables, however, I'm extremely new to matlab so am unsure about how to officially start. <br>
<br>
I've been told also to avoid the top 10% of the data. So would you assign all the variables in to groups, then avoid top 10% and then start plotting through a TTide harmonic analysis? <br>
<br>
Any input into this would be extremely useful as I've looked through the matlab tutorials and they haven't helped me as much. <br>

Mon, 27 Mar 2017 09:56:20 +0000
Re: How to reduce mat file size?
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347968#952687
dpb
On 03/27/2017 1:04 AM, sam wrote:<br>
...<br>
<br>
> I believe that since the max(max(abs(data))) (where data is m x n<br>
> matrix) is of order 1e+03, the reduction of digits by half is completely<br>
> justifiable.<br>
> Probably should be careful that after loading single precision data, it<br>
> is good to convert it to double for further analysis or calculations in<br>
> double precision, true?<br>
<br>
It's not magnitude so much that matters as precision; you're reducing to <br>
56 significant (decimal) digits in the conversion and those aren't <br>
coming back by converting back to double. Whether it matters or not <br>
will depend on what type of operations and whether those other digits <br>
are or are not actually significant or not. If, for example, <br>
differences are part of the needed analysis, the conversion _may_ lead <br>
to zeros where there really is a difference; again depending upon <br>
whether or not there are actual differences at that level originally or <br>
not and, as you note earlier, whether those differences if they do exist <br>
are actually anything more than noise.<br>
<br>
Can't tell from here, you've not provided sufficient information to have <br>
a klew what the data really are...one thing to try is the same <br>
calculations with both data sets to see the difference in results.<br>
<br>


Mon, 27 Mar 2017 09:53:03 +0000
Re: new directional weighted median filters
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/323818#952686
shafaq nisar
<br>
How I can detect Random valued impulse noise? I want to detect noisy pixels on some blank image

Mon, 27 Mar 2017 09:47:30 +0000
Re: removing multiple elements from an array
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/148688#952685
dpb
On 03/27/2017 2:27 AM, Atinesh Singh wrote:<br>
...<br>
<br>
>> Wow! Surprise for me...<br>
>><br>
><br>
> What if we want to delete element by value instead of index<br>
<br>
doc find % to use indices<br>
<br>
or search on "logical indexing"<br>
<br>
If the above was, indeed, a surprise, work through the tutorials in the <br>
"Getting Started" section in the documentation.<br>
<br>


Mon, 27 Mar 2017 08:55:03 +0000
how to 'imwrite' multiple gradient images
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347972#952684
Anna Klimkowska
I would like to save multiple gradient magnitude images obtained by imgradient function in specified direction.<br>
<br>
Here is my code:<br>
image_folder = 'xxxxx'; <br>
image_names = dir(fullfile(image_folder, '*bmp')); <br>
number_images = numel(image_names); <br>
<br>
for k =1:number_images<br>
full_name = fullfile(image_folder, image_names(k).name); <br>
rgbImg = imread(full_name); <br>
gsImg = rgb2gray(rgbImg); <br>
figure(k) <br>
imshow(gsImg) <br>
grayBlur = imgaussfilt(gsImg, 5); <br>
figure(k) <br>
imshow(grayBlur)<br>
[Gmag, Gdir] = imgradient(grayBlur, 'prewitt'); <br>
Gmag = (Gmag  min(Gmag(:)))./(max(Gmag(:))min(Gmag(:)));<br>
Gdir = (Gdir  min(Gdir(:)))./(max(Gdir(:))min(Gdir(:)));<br>
end<br>
<br>
For single image I used following function:<br>
imwrite(uint8(255.*Gmag),'grayBlur_mag.png');<br>
<br>
but I have a problem with implementing it for multiple images.<br>
<br>
Thank you for your help in advance

Mon, 27 Mar 2017 07:27:03 +0000
Re: removing multiple elements from an array
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/148688#952683
Atinesh Singh
"cPasFort" <tous@par.la.com> wrote in message <F0o4i.52653$Bs3.176517@wagner.videotron.net>...<br>
> <br>
> "Jos" <x@y.z> wrote in message news:ef57aa2.0@webcrossing.raydaftYaTP...<br>
> > alayi wrote:<br>
> > <SNIP howto remove items<br>
> ><br>
> > A = 1:10 ; % 1D array<br>
> > ind = [1 4 7] ; % indices to be removed<br>
> > A(ind) = [] ; % remove<br>
> ><br>
> > hth<br>
> > Jos<br>
> <br>
> Wow! Surprise for me... <br>
> <br>
> <br>
<br>
What if we want to delete element by value instead of index

Mon, 27 Mar 2017 06:58:03 +0000
Re: closing help window from command prompt
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/59387#952682
Ulrich Reif
ajaysachi <ajaysachi@yahoo.com> wrote in message <eecea26.1@webx.raydaftYaTP>...<br>
> how to close the help window from command prompt.<br>
> Thanks<br>
<br>
The command<br>
<br>
com.mathworks.mlservices.MatlabDesktopServices.getDesktop.closeGroup('Help')<br>
<br>
closes the help window. Regards, Uli

Mon, 27 Mar 2017 06:39:03 +0000
Re: Simulink Arduino Serial Communication  Multiple Signals, One Communication Port
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347963#952681
Pradeep KS
In R2016a, Simulink Arduino Support package Serial Transmit block is enhanced to support different Simulink Data types. <br>
<br>
For example:<br>
Arduino is sending 3 values 1234, 5678 and 4321 of data type 'int16' every 2ms.<br>
<br>
On the MATLAB command line,<br>
s=serial('com4') % Specify the Arduino COM port number<br>
fopen(s)<br>
<br>
Data = fread(s,3,'int16')<br>
<br>
Resullt:<br>
<br>
Data =<br>
<br>
1234<br>
5678<br>
4321<br>
<br>
<br>
"N Kando" wrote in message <ob6h87$scj$1@newscl01ah.mathworks.com>...<br>
> I posted this at:<br>
> <br>
> <a href="http://stackoverflow.com/questions/43009790/simulinkarduinoserialcommunicationmultiplesignalsonecommunicationport">http://stackoverflow.com/questions/43009790/simulinkarduinoserialcommunicationmultiplesignalsonecommunicationport</a><br>
> <br>
> to no avail.<br>
> <br>
> I am connecting to an Arduino 2650 via Simulink.<br>
> To communicate from the Arduino to the Simulink PC,<br>
> I use a single Serial Transmit block.<br>
> <br>
> Once the block has been deployed into the hardware,<br>
> I can read a signal of up to uint8 precision<br>
> using the fread command.<br>
> <br>
> How can I setup:<br>
> <br>
> reads with data greater than 8 bits?<br>
> reads of multiple signals of varying datatypes?<br>
> reads of multiple signals of varying datatypes with varying sample rates?<br>
> Example:<br>
> 3x uint8 @0500[Hz]<br>
> 3x uint16 @0500[Hz]<br>
> 2x single @1000[Hz]<br>
> writes of the same?<br>
> Notes<br>
> <br>
> Hints regarding model setup were given at:<br>
> <br>
> https://www.mathworks.com/matlabcentral/answers/235780sendingmultiplesignalsoverserialconnectiontofromsimulinkarduino<br>
> <br>
> but I think he reads in Simulink and not Matlab.<br>
> <br>
> Hints regarding serial reads were given at<br>
> <br>
> <a href="http://stackoverflow.com/questions/32909040/matlabfreadspeedupreadingfilewithmultipledatatypesandmultiplesampl">http://stackoverflow.com/questions/32909040/matlabfreadspeedupreadingfilewithmultipledatatypesandmultiplesampl</a><br>
> <br>
> but the model setup to send is not given.

Mon, 27 Mar 2017 06:04:03 +0000
Re: How to reduce mat file size?
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347968#952680
sam
"dpb" wrote in message <ob8k6g$7uu$1@dontemail.me>...<br>
> On 03/26/2017 7:08 AM, sam wrote:<br>
> > I have a big *.mat file stored on disk. I'm thinking that since the data<br>
> > matrix in the file is only measurements and thus more than half of the<br>
> > saved digits is irrelevant, is there any way to reduce the number of<br>
> > digits and hence significantly reduce the file size?<br>
> ><br>
> > I have tried for example fprintf to save the data into txt file but of<br>
> > course the resulting file is still bigger than the mat file, which seems<br>
> > to be compressed.<br>
> <br>
> All variables in Matlab are double floats by default unless you cast <br>
> them to something else. If the data is floating point, you can cut <br>
> memory size in half by<br>
> <br>
> data=single(data);<br>
> <br>
> If it's say, 10 bit A/D data and hence integer, you can save another <br>
> factor of two as<br>
> <br>
> data=int16(data);<br>
> <br>
> Actual storage efficiency I don't know about, but using a shorter memory <br>
> model will at least give SAVE a chance to save disk space as well.<br>
> <br>
> <br>
<br>
Thanks, have tested it and the file size is reduced almost by half, which is great.<br>
<br>
I believe that since the max(max(abs(data))) (where data is m x n matrix) is of order 1e+03, the reduction of digits by half is completely justifiable. <br>
<br>
Probably should be careful that after loading single precision data, it is good to convert it to double for further analysis or calculations in double precision, true?

Mon, 27 Mar 2017 05:36:52 +0000
Re: Simmechanics second generation
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/344149#952679
abdalazizalmokadem@gmail.com
was ur problem solved?

Mon, 27 Mar 2017 04:24:03 +0000
i am getting the same message .Is there any other methods to resolve this problem
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/332533#952678
Shefiah Shershah
"Phil Goddard" wrote in message <l5kkk6$cvd$1@newscl01ah.mathworks.com>...<br>
> Chances are that you have an inf or nan and hence reducing the step size will make no difference.<br>
> But to do so you use the Solver options on the Simulation>Model Configuration Parameters menu.<br>
> <br>
> Phil.

Mon, 27 Mar 2017 04:23:03 +0000
Re: How to reduce step size in SIMULINK
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/332533#952677
Shefiah Shershah
"Phil Goddard" wrote in message <l5kkk6$cvd$1@newscl01ah.mathworks.com>...<br>
> Chances are that you have an inf or nan and hence reducing the step size will make no difference.<br>
> But to do so you use the Solver options on the Simulation>Model Configuration Parameters menu.<br>
> <br>
> Phil.

Mon, 27 Mar 2017 02:14:13 +0000
Re: How do I mask random rows in a matrix to all 1's and the resulting
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347971#952676
dpb
On 03/26/2017 5:10 PM, dpb wrote:<br>
> On 03/26/2017 4:10 PM, Tsdale Mehari wrote:<br>
>> I have a matrix of [6000,250] and I need to randomly mask 225 rows to<br>
>> ones and the remaining 5775 rows to become zeros<br>
><br>
> M=0;<br>
> M(randperm(length(M,225),:))=1;<br>
<br>
M(randperm(length(M),225),:)=1;<br>
<br>
misplaced closing paren above corrected...<br>
<br>


Sun, 26 Mar 2017 22:15:03 +0000
Re: Screw Nut don't translate in SimMechanical
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/299607#952675
Abdalazi Elmokadem
Have you got an Answer?<br>
if yes I need it plz since i'm having the same problem<br>
<br>
<br>
"Guillaume MARTIN" wrote in message <if2euh$dfb$1@fred.mathworks.com>...<br>
> Hello,<br>
> <br>
> I may be dumb, but I can't make translate a screw nut in SimMechanical. I've seen many exemples in the internet. Many of them for the stewart platform.<br>
> <br>
> But my screw nut don't translate !<br>
> <br>
> I have :<br>
>  A machine environnement.<br>
>  A Ground, at [0 0 0]<br>
>  The Body "Screw". CG [0 0 0]<br>
>  A Revolute join. Axis [1 0 0], who drives the Screw in the ground.<br>
> <br>
>  The body "Screw Nut" [0 0 0]<br>
>  A Prismatic join. Axis [1 0 0], who drive the screw nut in the ground.<br>
> <br>
>  A Screw join. Axis [1 0 0], who drives the screw nut around the screw.<br>
> <br>
> A join actuator actuates the revolute join.<br>
> <br>
> When I simulate, this is curious :<br>
>  A translation and rotation mouvement is detected in the screw join (Normal)<br>
>  BUT : no mouvement is detected in the translation join....<br>
> <br>
> <br>
> Do I am clear ?<br>
> Could someone send me an exemple of a screw nut translating ? <br>
> Could I show the simmechanical file to someone who will laught a me saying "ha ha ha, your screw nut don't translate because... "?<br>
> <br>
> <br>
> Thank you very much,<br>
> <br>
> Guillaume MARTIN<br>
> <br>
> <br>
> <br>
>

Sun, 26 Mar 2017 22:10:43 +0000
Re: How do I mask random rows in a matrix to all 1's and the resulting
https://fr.mathworks.com/matlabcentral/newsreader/view_thread/347971#952674
dpb
On 03/26/2017 4:10 PM, Tsdale Mehari wrote:<br>
> I have a matrix of [6000,250] and I need to randomly mask 225 rows to<br>
> ones and the remaining 5775 rows to become zeros<br>
<br>
M=0;<br>
M(randperm(length(M,225),:))=1;<br>
<br>
