Rank: 2944 based on 13 downloads (last 30 days) and 5 files submitted
photo

Yanai

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Yanai View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
01 Nov 2010 folderSizeTree Calculate total size of sub-folders recursively Author: Yanai folder, recursive, size, subfolder, bytes 2 1
  • 5.0
5.0 | 1 rating
31 Aug 2010 if-then-else shortcut The function is a shortcut for simple if conditions, to reduce redundant code Author: Yanai if, then, else, code 3 2
15 Sep 2009 Link figures Link the axes of different figures for zoom and pan Author: Yanai zoom, pan, figures, images, axes, link 3 0
15 Sep 2009 Auto-process all files in sub-folders Runs user-specified function on all files in a folder Author: Yanai crawler, subdir 4 0
14 Sep 2009 Screenshot Improvement to Title function Add the "title" string to figure title (blue area) Author: Yanai figure, title, windows, taskbar, plot 1 1
  • 5.0
5.0 | 1 rating
Comments and Ratings by Yanai View all
Updated File Comments Rating
31 Aug 2010 if-then-else shortcut The function is a shortcut for simple if conditions, to reduce redundant code Author: Yanai

Thanks Oleg for you comment.
Regarding the 2nd example you wrote, I agree I should have returned an error, since there is no meaning in using non-scalars as condition, and an expression as result.

In the 1st example, the behavior is required IMO, but maybe the documentation is lacking. If x is non-scalar there are two possible uses:
1) as I wrote in my example2 (all inputs are non-scalars)
2) result is 5 where x>thr, and 3 elsewhere

 

31 Aug 2010 xml2struct Convert an xml file into a MATLAB structure for easy access to the data. Author: Wouter Falkena
Comments and Ratings on Yanai's Files View all
Updated File Comment by Comments Rating
18 Mar 2011 folderSizeTree Calculate total size of sub-folders recursively Author: Yanai Arsalan, Muhammad

Good one.

31 Aug 2010 if-then-else shortcut The function is a shortcut for simple if conditions, to reduce redundant code Author: Yanai Yanai

Thanks Oleg for you comment.
Regarding the 2nd example you wrote, I agree I should have returned an error, since there is no meaning in using non-scalars as condition, and an expression as result.

In the 1st example, the behavior is required IMO, but maybe the documentation is lacking. If x is non-scalar there are two possible uses:
1) as I wrote in my example2 (all inputs are non-scalars)
2) result is 5 where x>thr, and 3 elsewhere

 

31 Aug 2010 if-then-else shortcut The function is a shortcut for simple if conditions, to reduce redundant code Author: Yanai Komarov, Oleg

I bring to the attention this behaviour:

ifelse([10,1] > 2,1,0)
ans =
     1 0

ifelse([10,1] > 2,'a = 1','b = 0')
b =
     0

As you can see its behaviour depends not on the first input (and on its features, a double row vector) but rather on the second and third argument.
This is totally unexpected and IMO unwanted.

This kind of problem is evident from the wrong "example 1". If x is not a scalar then the if-else construct doesn't describe what the function does.

14 Sep 2009 Improvement to Title function Add the "title" string to figure title (blue area) Author: Yanai Rowland, Darren

Simple (only 4 lines of code) but very clever improvement to the basic behavior of title. I see no reason why this shouldn't be adopted into Matlab.

Top Tags Applied by Yanai
axes, bytes, code, crawler, else
Files Tagged by Yanai View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
01 Nov 2010 folderSizeTree Calculate total size of sub-folders recursively Author: Yanai folder, recursive, size, subfolder, bytes 2 1
  • 5.0
5.0 | 1 rating
31 Aug 2010 if-then-else shortcut The function is a shortcut for simple if conditions, to reduce redundant code Author: Yanai if, then, else, code 3 2
15 Sep 2009 Link figures Link the axes of different figures for zoom and pan Author: Yanai zoom, pan, figures, images, axes, link 3 0
15 Sep 2009 Auto-process all files in sub-folders Runs user-specified function on all files in a folder Author: Yanai crawler, subdir 4 0
14 Sep 2009 Screenshot Improvement to Title function Add the "title" string to figure title (blue area) Author: Yanai figure, title, windows, taskbar, plot 1 1
  • 5.0
5.0 | 1 rating

Contact us at files@mathworks.com