Re: Which name will be returned when forcing load function to treat the fig-file as a MAT-file?
- From: Tsai <hottsai@xxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 09:41:38 -0500
Steve Simon wrote:
>
>
> Tsai wrote:
>> when I use
>>
>> load('-mat', 'figure-file-name.fig')
>>
>> to load a figure file by forcing the figure file treated
>>
>> as a MAT-file, regardless of file extension FIG.
>>
>> It returns a structure variable named "hgS_070000" for MATLAB
> R14SP2.
>>
>> Could someone please tell me, whether the variable name is
> dependent
>> on the MATLAB version and how would it be specified for
different
>> versions (R14, R14SP1,R14SP2 and R14SP3)?
>
> Why not just specify an output from LOAD:
>
> S = load('-mat','figure-file-name.fig');
>
> It will still have the name as a field name, but it should be the
> only
> field, so you could do something like this:
>
> fn = fieldnames(S);
> figVar = getfield(S,fn{1}); % or figVar = S.(fn{1});
>
> Now you have the contents of the variable, and it doesn't matter
> what
> the original name was.
>
> -Steve Simon
>
Thanks a lot, Steve.
I have used the EVAL function to create a new structure which saves
the same contents as the output from LOAD. And the new structure has
exactly the field name, for example, hgS_070000.
my current question is, that after online Product Support
1103 Functions which use the EVAL function cannot be translated into
C or C++ code using the MATLAB Compiler.
But I have successfully compiled my code using Microsoft Visual C/C++
..NET Compiler under R14SP1 and R14SP2.
Does it mean that this Compiler supports the compilation of EVAL
function?
Is there a risk which causes potentially errors?
Thanks!
Tsai
.
- Follow-Ups:
- References:
- Prev by Date: Re: "Conversion to double from sym is not possible"
- Next by Date: Wiggleplot?
- Previous by thread: Re: Which name will be returned when forcing load function to treat the fig-file as a MAT-file?
- Next by thread: Re: Which name will be returned when forcing load function to treat the fig-file as a MAT-file?
- Index(es):
Relevant Pages
|