Loading...
t=0:pi/50:10*pi; plot3(sin(t),cos(t),t) xlabel('sint') ylabel('cost') zlabel('t') grid on axis square %让界面变方
x = 0:0.01:2*pi %起始:步长:结束 y = sin(x) figure %建立幕布 plot(x,y) %画图 title(...
for循环for i = 初始:步长:结束 end打印一个矩阵元素A = [1, 2, 3; 4, 5, 6; 7, 8, 9]; for i = 1:1:3 for j = 1:1:3 A(i,j) end endwhile循环while 条件 endifif 表达式 elseif 表达式 end表达式可以加括号也可以不加switchswitch 表达...
A(x,y)A的x行y列元素A(x,:)A的x行子矩阵A(:,y)A的y列子矩阵[x,y] = find(A>20)找A中大于20的元素,索引以矩阵...
传入数据应该为地址如void sort(int* arr, int size, int (*compare)(int*, int*)) { for (int i = 0; i < size - 1; i++) { for (int j = 0; j < size - i - 1; j++) { if (compare(&ar...