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

多個返回值

相關文章
相關標籤/搜索