MATLAB练习例子二
返回
》 profile on -detail builtin -history
》 [t,y] = ode23('lotka',[0 2],[20,20]);
》 profile report lotkaprof
》 stats = profile('info')
stats =
FunctionTable: [28x1 struct]
FunctionHistory: [2x774 double]
ClockPrecision: 0.0160
》 stats.FunctionTable
ans =
28x1 struct array with fields:
FunctionName
MfileName
Type
NumCalls
TotalTime
TotalRecursiveTime
Children
Parents
ExecutedLines
》 stats.FunctionTable(2)
ans =
FunctionName: 'ode23'
MfileName: 'C:\MATLAB\toolbox\matlab\funfun\ode23.m'
Type: 'M-function'
NumCalls: 1
TotalTime: 0.0310
TotalRecursiveTime: 0.0310
Children: [21x1 struct]
Parents: [0x1 struct]
ExecutedLines: [159x3 double]
》 save profstats
》 load profstats
》 profreport(stats)
-----------------------------------------------------------------
》 t=0:pi/4:2*pi;
》 y=sin(t);
》 y
y =
Columns 1 through 7
0 0.7071 1.0000 0.7071 0.0000 -0.7071 -1.0000
Columns 8 through 9
-0.7071 -0.0000
》
》 A = magic(3)
A =
8 1 6
3 5 7
4 9 2
》 who
Your variables are:
A
》 whos
Name Size Bytes Class
A 3x3 72 double array
Grand total is 9 elements using 72 bytes
》
保存workspace
test.mat
读取workspace
load('test')
File Type Extension
Figure file fig
M-file m
MAT-file mat
Model mdl
P-file p
返回