Rank: 19666 based on 0 downloads (last 30 days) and 0 files submitted
photo

Liang

E-mail
Company/University
Strathclyde

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Liang
Updated File Comments Rating
09 Feb 2009 igesout Convert surfaces, curves and lines to IGES file Author: Daniel Claxton

It is really an excellent code. However, when I try to create a large geometry, it is still time consuming. The function 'swap' excutes too many string copy in the 'while' loop and it cost much time when there are a mount of data points. I rewrote the function as follow and the it only needs 1/3 time.

function s = wrap(str,delim,n)
    tmp = blanks(n);
    strlength = length(str);
    i = 1;
    index=1;
    while (strlength-index+1>n)
        tmp = str(index:index+n-1);
        d = strfind(tmp,delim);
        d = d(end);
        index = index + d;
        s(i,:) = [tmp(1:d) blanks(n-d)];
        i = i+1;
    end
    if (strlength-index+1>0)
        s(i,:) = [str(index:strlength) blanks(n-(strlength-index+1))];
    end

Contact us at files@mathworks.com