Rank: 3878 based on 24 downloads (last 30 days) and 2 files submitted
photo

huang

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by huang View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Sep 2013 struct2string decompilation a struct to a string which creats it Author: huang data export 11 1
19 Sep 2013 cell2string cell2string(var) get the sentence which var created the input variable var must to be a cell Author: huang script 13 3
  • 2.0
2.0 | 2 ratings
Comments and Ratings by huang View all
Updated File Comments Rating
13 Mar 2013 AutoSizeOnConnect Automatically resizes the number of ports on a block for automatic connection. Author: Mike Anthony

Hi, Mike Anthony.
I got a bug, which i think.
when i dislink a block to the buscreator,which i used the tool to connected, and relink it to the block normally, something unrespected happend, the buscreator resized.
hope it useful to you,and fixed the hole.

13 Mar 2013 AutoSizeOnConnect Automatically resizes the number of ports on a block for automatic connection. Author: Mike Anthony

Comments and Ratings on huang's Files View all
Updated File Comment by Comments Rating
20 Sep 2013 cell2string cell2string(var) get the sentence which var created the input variable var must to be a cell Author: huang Simon, Jan

You forgot to mention, that this function requires your struct2string() also and the other way around.

The types and sizes of the correctly treated fields/cell elements is limited, but not mentioned in the documentation. E.g. matrices with more than 2 dimensions and non-scalar LOGICALs appear confusingly in the output.

Such a function must have limitations, of course. But they must be explained clearly in the documentation. And instead of printing an incorrect string, a rejection in form of a warning or error would be smarter.

26 Dec 2012 cell2string cell2string(var) get the sentence which var created the input variable var must to be a cell Author: huang Simon, Jan

What happens for cells with more than 2 dimensions? The output for {[true, false]} is confusing, because vectors or arrays are not considered. Strings are enclosed in square brackets only, if they are not the first element in a cell.

The code can be simplified substantially. E.g.:
for i=1:f
for j=1:v
cellstring = ...
end
cellstring = [ cellstring ','];
end
instead of checking "if j==v" in each iteration and appending the comma in the last iteration only.

Adding a leading brace in the case of "cfPointer == 1 && cvPointer == 1" does not require two (almost) equal blocks of code for the conversion. This is simpler:
if cfPointer == 1 && cvPointer == 1
cellstring = [cellstring, '{'];
end
And then one conversion block is enough.

The list of allowed inputs does not contain the type cell, although this is shown in the example. But the limitation to scalar inputs is more important.

20 Dec 2012 cell2string cell2string(var) get the sentence which var created the input variable var must to be a cell Author: huang Simon, Jan

"strfind(var, '')" will not compare var with an empty string. Perhaps you want "isqual(var, '')".
The allowed types of the inputs are not explained in the help section. E.g. you check for doubles and cells only, but what happens for elements of type STRUCT, SINGLE or UINT16? E.g. the {1,1} element must be a string, but as long as this is not explained, other users will run into troubles.
Inserting empty string in "[cellstring '' num2str(var) '']" is not useful.

Currently the usability of your submissions is very limited. I will brushup my votes, if you improve the help section, more types of elements are considered, and a warning or error handles not supported types.

22 Nov 2012 struct2string decompilation a struct to a string which creats it Author: huang Simon, Jan

If you have check the type of a field by "if ~isstruct()" you do not have to check by "elseif isstruct()" afterwards, but a simple "else" is enough.

It would be useful to specify the accepted sizes and types of the inputs: The function runs on scalar structs only. The fields can be strings, scalar doubles or empty. But what about cell strings, CHAR matrices, singles or integers? This should be explained in the documentation and caught by an exception handling.

Contact us