octave

 https://www.coursera.org/learn/machine-learning/resources/QQx8lide

 

 

 

 

 

 

 

 

 服从高斯分布 放差标准差为1orm

10000元素的向量blog

hist 绘图  hist(w,50)  50个竖条ci

 

 

 

 

返回行数 列数element

 

lengthit

 

 

vio

 

 

1 3 行全部列的元素function

 

 

 

   和[A,B]同样变量

 

 乘法和点乘grid

 

  v 是(1,2,3)'  也能够v+1

 

 若是是矩阵会获得每一列的最大值

 

 

 

 

 

 任意行列对角线加起来等于相同的值 ML基本用不到

 

 

sum 统加 proud 统乘

向下向上取整

 

第二种是两个3*3矩阵的较大值组成

 2就是每一行的最大值

整个矩阵的最大值

 

每列求和

求逆

 

 

%% plotting
t = [0:0.01:0.98];
y1 = sin(2*pi*4*t);
plot(t,y1);
y2 = cos(2*pi*4*t);
hold on; % "hold off" to turn off
plot(t,y2,'r');
xlabel('time');
ylabel('value');
legend('sin','cos');
title('my plot');
print -dpng 'myPlot.png'
close; % or, "close all" to close all figs
figure(1); plot(t, y1);   //图1
figure(2); plot(t, y2);  %图2
figure(2), clf; % can specify the figure number
subplot(1,2,1); % Divide plot into 1x2 grid, 最后一个1的意思:access 1st element 
plot(t,y1); 而后上图
subplot(1,2,2); % Divide plot into 1x2 grid, access 2nd element 2的意思
plot(t,y2); 上图
axis([0.5 1 -1 1]); % change axis scale  x轴和 y轴的范围

clf清除图像

%% display a matrix (or image)
figure;
imagesc(magic(15)), colorbar, colormap gray;   不一样颜色对应不一样数值 颜色条 和灰色分布
% comma-chaining function calls.
a=1,b=2,c=3 一个接一个执行
a=1;b=2;c=3;

 

 

function y = squareThisNumber(x)

y = x^2;   返回一个值存放于y 要一个自变量x

多个返回值

相关文章
相关标签/搜索