Rank: 708 based on 183 downloads (last 30 days) and 4 files submitted
photo

James Slegers

E-mail
Company/University
Iowa State University

Personal Profile:
Professional Interests:
Electrical Power Engineering

 

Watch this Author's files

 

Files Posted by James View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Jun 2013 Screenshot struct2csv Output a structure to a .csv file, with column headers Author: James Slegers csv, struct, struct2csv, header, data export 95 11
  • 4.83333
4.8 | 6 ratings
08 Jun 2012 Screenshot kml2struct Import a .kml file as a series of shapefile structs. Like kml_shapefile, but more stable. Author: James Slegers kml_shapefile, kml, shapefile, struct, import kml, potw 63 3
  • 4.33333
4.3 | 3 ratings
04 Mar 2011 Screenshot subplace SUBPLACE Computes 'Position' vectors for a center-aligned set of subplots of varying row lengths Author: James Slegers subplot, plot, position, visualization, figure, axis 14 1
  • 5.0
5.0 | 1 rating
10 Feb 2011 tf2tex Creates a Tex string based on a transfer function object Author: James Slegers control design, data export, tf, transfer function, tex, string 11 0
Comments and Ratings by James View all
Updated File Comments Rating
03 Dec 2013 struct2csv Output a structure to a .csv file, with column headers Author: James Slegers

Nerual, please give an example of a matrix or array that gives this error. The function takes a number of different input types (cell arrays, matrices, etc), so it is not immediately clear to me what would cause that error.

Benny, again, please give an example of the matrix or array that causes this error. As to nested structs, those are not handled by this function, because it is not recursive, and it's not clear to me how such information could be laid out nicely in a tabular worksheet (.csv).

27 Aug 2013 struct2csv Output a structure to a .csv file, with column headers Author: James Slegers

The precision is controlled by one of the numerous "num2str" arguments in the file. I did not give any specific number format strings, because it was made to be general-purpose. I'll put some thought to it, see if I can improve it. In the meantime, if you need the precision, look for the right "num2str", and pass it a format string.

Comments and Ratings on James' Files View all
Updated File Comment by Comments Rating
20 Jun 2014 struct2csv Output a structure to a .csv file, with column headers Author: James Slegers Cavalcanti, Rodrigo

Excellent file. Just had wrong imports when the fields were blank ([]). Fixed it by changing the following:
for jj = 1:m
c = s(rr).(headers{jj});
str = '';
if sz(jj,1)<ii
str = repmat(',',1,sz(jj,2));
%% Added code
if sz(jj,2) ==0 %MOdified
str = repmat(',',1,1);
end
%%Finish added code
else
if isnumeric(c)
for kk = 1:sz(jj,2)

Thanks!

21 Apr 2014 kml2struct Import a .kml file as a series of shapefile structs. Like kml_shapefile, but more stable. Author: James Slegers Young, David

Repeating Brian Emery's point: it's important that the "Required Products" list includes the mapping toolbox. At the time of writing this comment, it's not listed as required.

06 Mar 2014 struct2csv Output a structure to a .csv file, with column headers Author: James Slegers Hugon, Francois

Great time saver, exactly what I needed. Thanks.

20 Feb 2014 struct2csv Output a structure to a .csv file, with column headers Author: James Slegers de Vries, Jaap

Very Nice Job!!!!

You saved me a ton of time today.
One nice addition would be a possibility to put a second row with units below row one that show the fields. I notice that many of my engineering data files have two header lines; one width the field names and the second line with the units.

17 Feb 2014 kml2struct Import a .kml file as a series of shapefile structs. Like kml_shapefile, but more stable. Author: James Slegers Paden, John

Contact us