View previous topic :: View next topic
Author
Message
smirnoff ( )
Posted: 2014-2-13 04:18
-------------------------- : --------------------------
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
Last edited by smirnoff on 2014-3-28 01:32; edited 8 times in total
|
smirnoff ( )
Posted: 2014-2-13 15:03
_BBCODE_CODE:
%% 定义 Time specifications:
Fs = 31416; % 每秒描的点数 samples per second
dt = 1/Fs; % 点之间的时间间隔 seconds per sample
StopTime = 0.1; % 作图完结时间点 seconds
t = (0:dt:StopTime-dt)'; % 作图时长分割 从0开始以dt为间距作图到 StopTime减掉一个间隔 seconds
%% 描述正(余)弦波 Sine wave:
Fc = 20; % 频率 hertz
x = cos(2*pi*Fc*t); % 注意隐含振幅为 1
figure;
plot(t,x); % 作图 Plot the signal Vs time:
xlabel('time (in seconds)'); % 横坐标文字提示
title('Signal Vs Time'); % 抬头
zoom xon;
grid on:加上格缐
gca:
get current axis的简称
传回目前使用中的图轴
gca属Handle Graphics的指令
_BBCODE_CODE:
x = 0:0.1:4*pi;
figure;
plot(x, sin(x)+sin(3*x))
set(gca,'ytick', [-1 -0.3 0.1 1]); % 在 y 轴加上指定的格缐点
grid on
将格缐点的数字改为文字
x = 0:0.1:4*pi;
plot(x, sin(x)+sin(3*x))
set(gca, 'ytick', [-1 -0.3 0.1 1]);
% 改变格缐点
set(gca, 'yticklabel', {'min','critical','breakdown','max'});
% 改变格缐点的文字
grid on
_BBCODE_CODE:
x = 0:0.1:4*pi;
plot(x, sin(x)+sin(3*x))
set(gca, 'ytick', [-1 -0.3 0.1 1]); % 改变格缐点
set(gca, 'yticklabel', {'min','critical','breakdown','max'});
% 改变格缐点的文字
grid on
Description:
Download
Filename:
Mathematica__演示_方波的形成_.rar
Filesize:
1.91 KB
Downloaded:
18 Time(s)
Description:
Download
Filename:
plot_sine_wave_smirnoff.rar
Filesize:
518 Bytes
Downloaded:
21 Time(s)
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
Last edited by smirnoff on 2014-2-15 03:19; edited 5 times in total
|
Back to top
smirnoff ( )
Posted: 2014-2-13 15:42
参考 Mathematica
参考 Mathematica
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
|
Back to top
smirnoff ( )
Posted: 2014-2-13 16:41
标量、向量、矩阵和数组是MATLAB运算中涉及的一组基本运算量。它们各自的特点及相互间的关系可以描述如下:
(1) 数组不是一个数学量,而是一个用于高级语言程序设计的概念。如果数组元素按一维线性方式组织在一起,那么称其为一维数组,一维数组的数学原型是向量。如果数组元素分行、列排成一个二维平面表格,那
么称其为二维数组,二维数组的数学原型是矩阵。如果元素在排成二维数组的基础上,再将多个行、列数分别相同的二维数组叠成一本立体表格,便形成三维数组。依此类推下去,便有了多维数组的概念。在MATLAB
中,数组的用法与一般高级语言不同,它不借助于循环,而是直接采用运算符,有自己独立的运算符和运算法则。
(2) 矩阵是一个数学概念,一般高级语言并未引入将其作为基本的运算量,但MATLAB是个例外。一般高级语言是不认可将两个矩阵视为两个简单变量而直接进行加减乘除的,要完成矩阵的四则运算必须借助于循环结
构。当MATLAB将矩阵引入作为基本运算量后,上述局面改变了。MATLAB不仅实现了矩阵的简单加减乘除运算,而且许多与矩阵相关的其他运算也因此大大简化了。
(3) 向量是一个数学量,一般高级语言中也未引入,它可视为矩阵的特例。从MATLAB的工作空间窗口可以查看到:一个n维的行向量是一个1×n阶的矩阵,而列向量则当成n×1阶的矩阵。
(4) 标量的提法也是一个数学概念,但在MATLAB中,一方面可将其视为一般高级语言的简单变量来处理,另一方面又可把它当成1×1阶的矩阵,这一看法与矩阵作为MATLAB的基本运算量是一致的。
(5) 在MATLAB中,二维数组和矩阵其实是数据结构形式相同的两种运算量。二维数组和矩阵的表示、建立、存储根本没有区别,区别只在它们的运算符和运算法则不同。
例如,向命令窗口中输入a=[1 2;3 4]这个量,实际上它有两种可能的角色:矩阵a或二维数组a。这就是说,单从形式上是不能完全区分矩阵和数组的,必须再看它使用什么运算符与其他量之间进行运算。
(6) 数组的维和向量的维是两个完全不同的概念。数组的维是从数组元素排列后所形成的空间结构去定义的:线性结构是一维,平面结构是二维,立体结构是三维,当然还有四维以至多维。向量的维相当于一维数组
中的元素个数。
ref:
blog.sina.com.cn/s/blo...0lg0z.html
www.matlabsky.com/thre...6-1-3.html
数组、矩阵和向量等几个概念的区别和讨论
www.coofish.org/post/256.html
Matlab标量、向量、矩阵与数组
blog.sina.com.cn/s/blo...0lg0z.html
Matlab标量、向量、矩阵、数组
blog.sina.com.cn/s/blo...003jg.html
MATLAB的数组,向量和矩阵的运算(1)
blog.sina.com.cn/s/blo...003jh.html
MATLAB的数组,向量和矩阵的运算(2)
Description:
Download
Filename:
标量、向量、矩阵和数组.rar
Filesize:
2.28 KB
Downloaded:
22 Time(s)
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
|
Back to top
smirnoff ( )
Posted: 2014-2-13 17:27
%绘制统计直方图
x=-2:0.1:2; % X轴画图的间隔
y=randn(10,2); %产生10*2的正态分布的随机矩阵
hist(y,x); %直方图显示y在x附近的元素的个数,按列绘制
%figure % 注释掉,暂时不用
%hist(y,20) %分20段,默认为十段
_BBCODE_CODE:
%绘制统计直方图
x=-2:0.1:2; % X轴画图的间隔
y=randn(10,2); %产生10*2的正态分布的随机矩阵
hist(y,x); %直方图显示y在x附近的元素的个数,按列绘制
%figure % 注释掉,暂时不用
%hist(y,20) %分20段,默认为十段
统计图
bar(Y):作向量Y的条形图。
bar(X,Y):作向量Y相对于X的条形图。
hist(X,k):将向量X中数据等距分为k组,并作频数直方图。k默认为10.
[N,X]=hist(Y,k): 不做图,N返回各组数据频数,X返回各组的中心位置。
boxplot(Y):作向量Y的箱型图。
ref:
www.cnblogs.com/gtts/a...55163.html
% 画概率密度直方分布图
y=rand(1,3000)
ymin=min(y);
ymax=max(y);
x=linspace(ymin,ymax,20); %将最大最小区间分成20个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x); %计算各个区间的个数
yy=yy/length(y); %计算各个区间的个数
bar(x,yy) %画出概率密度分布图
_BBCODE_CODE:
% 画概率密度直方分布图
y=rand(1,3000)
ymin=min(y);
ymax=max(y);
x=linspace(ymin,ymax,20); %将最大最小区间分成20个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x); %计算各个区间的个数
yy=yy/length(y); %计算各个区间的个数
bar(x,yy) %画出概率密度分布图
% 画概率密度直方分布图
split_number=100;
y=rand(1,3000);
ymin=min(y);
ymax=max(y);
x=linspace(ymin,ymax,split_number); %将最大最小区间分成split_number个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x); %计算各个区间的个数
yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
bar(x,yy) %画出概率密度分布图
_BBCODE_CODE:
% 画概率密度直方分布图
split_number=100;
y=rand(1,3000);
ymin=min(y);
ymax=max(y);
x=linspace(ymin,ymax,split_number); %将最大最小区间分成split_number个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x); %计算各个区间的个数
yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
bar(x,yy) %画出概率密度分布图
% 画概率密度直方分布图
split_number=100;
y=rand(1,3000);
ymin=min(y);
ymax=max(y);
x=ymin:(ymax-ymin)/split_number:ymax ; %将最大最小区间分成split_number个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x); %计算各个区间的个数
yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
bar(x,yy) %画出概率密度分布图
_BBCODE_CODE:
% 画概率密度直方分布图
split_number=100;
y=rand(1,3000);
ymin=min(y);
ymax=max(y);
x=ymin:(ymax-ymin)/split_number:ymax ; %将最大最小区间分成split_number个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x); %计算各个区间的个数
yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
bar(x,yy) %画出概率密度分布图
ref:
www.biostatistic.net/t...7-1-1.html
ref :
PREDICTING THE LOTTERY WITH MATLAB NEURAL NETWORK
scriptbucket.wordpress...l-network/
simulate a lottery with random vector
www.mathworks.com/matl...ead/251270
Computing Moral Hazard Programs With Lotteries Using Matlab
Alexander Karaivanov
www.sfu.ca/~akaraiva/MHmatlab.pdf
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
Last edited by smirnoff on 2014-2-15 02:31; edited 6 times in total
|
Back to top
smirnoff ( )
Posted: 2014-2-14 16:38
仿真螺旋天线的第一步, 知道怎么画 Helix
% Ploting a helix with N-turns
turns = 12; helix_radius = 0.02;
wire_dia = 2;
wire_length = 0:pi/18000:turns*2*pi;
max_length = 200;
plot_margin = 0.01;
plot3(helix_radius * sin(wire_length),helix_radius * cos(wire_length), wire_length, 'LineWidth', wire_dia);
zlim([0 max_length]);
xlim([-(plot_margin + helix_radius) (plot_margin + helix_radius)]);
ylim([-(plot_margin + helix_radius) (plot_margin + helix_radius)]);
xlabel('Right Side');
ylabel('Front Side)');
zlabel('Axial Length');
axis square;
grid on
_BBCODE_CODE:
% Ploting a helix with N-turns
turns = 12; helix_radius = 0.02;
wire_dia = 2;
wire_length = 0:pi/18000:turns*2*pi;
max_length = 200;
plot_margin = 0.01;
plot3(helix_radius * sin(wire_length),helix_radius * cos(wire_length), wire_length, 'LineWidth', wire_dia);
zlim([0 max_length]);
xlim([-(plot_margin + helix_radius) (plot_margin + helix_radius)]);
ylim([-(plot_margin + helix_radius) (plot_margin + helix_radius)]);
xlabel('Right Side');
ylabel('Front Side)');
zlabel('Axial Length');
axis square;
grid on
ref:
www.mathworks.com/help...plot3.html
画圆
theta = 0:pi/31416:2*pi;
r = 1;
x = r*cos(theta);
y = r*sin(theta);
plot(x, y)
axis square; grid on
_BBCODE_CODE:
theta = 0:pi/31416:2*pi;
r = 1;
x = r*cos(theta);
y = r*sin(theta);
plot(x, y)
axis square; grid on
_BBCODE_CODE:
xCenter = 12;
yCenter = 10;
theta = 0 : 0.01 : 2*pi;
radius = 5;
x = radius * cos(theta) + xCenter;
y = radius * sin(theta) + yCenter;
plot(x, y);
axis square;
xlim([0 20]);
ylim([0 20]);
grid on;
画椭圆
ref:
www.sciencedirect.com/...0300001527
xCenter = 12.5;
yCenter = 10;
xRadius = 2.5;
yRadius = 8;
theta = 0 : 0.01 : 2*pi;
x = xRadius * cos(theta) + xCenter;
y = yRadius * sin(theta) + yCenter;
plot(x, y, 'LineWidth', 3);
axis square;
xlim([0 20]);
ylim([0 20]);
grid on;
_BBCODE_CODE:
xCenter = 12.5;
yCenter = 10;
xRadius = 2.5;
yRadius = 8;
theta = 0 : 0.01 : 2*pi;
x = xRadius * cos(theta) + xCenter;
y = yRadius * sin(theta) + yCenter;
plot(x, y, 'LineWidth', 3);
axis square;
xlim([0 20]);
ylim([0 20]);
grid on;
www.mathworks.com/matl...ead/301419
How do I create a circle?
matlab.wikia.com/wiki/..._circle.3F
plot::Circle2d(r, <[x, y]>, , options)
www.mathworks.com/help...cle2d.html
Description:
Download
Filename:
Ploting_a_helix.rar
Filesize:
356 Bytes
Downloaded:
20 Time(s)
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
|
Back to top
smirnoff ( )
Posted: 2014-2-15 02:52
Description
peaks is a function of two variables, obtained by translating and scaling Gaussian distributions, which is useful for demonstrating mesh, surf, pcolor, contour, and so on.
Z = peaks; returns a 49-by-49 matrix.
Z = peaks(n); returns an n-by-n matrix.
Z = peaks(V); returns an n-by-n matrix, where n = length(V).
Z = peaks(X,Y); evaluates peaks at the given X and Y (which must be the same size) and returns a matrix the same size.
peaks(...) (with no output argument) plots the peaks function with surf.
[X,Y,Z] = peaks(...); returns two additional matrices, X and Y, for parametric plots, for example, surf(X,Y,Z,del2(Z)). If not given as input, the underlying matrices X and Y are
[X,Y] = meshgrid(V,V)
where V is a given vector, or V is a vector of length n with elements equally spaced from -3 to 3. If no input argument is given, the default n is 49.
Example:
y = peaks;
% 产生一个 49×49 的矩阵
plot(y);
% 对矩阵 y 的每一个行向量作图
_BBCODE_CODE:
y = peaks; % 产生一个 49×49 的矩阵
plot(y); % 对矩阵 y 的每一个行向量作图
_BBCODE_CODE:
x = peaks;
y = x'; % 求矩阵 x 的转置矩阵 x'
plot3(x, y, x*y); grid on % 取用矩阵 y 的每一行向量,与对应矩阵 x % 的每一个行向量作图
%同时画出四个图於一个视窗中
x = 0:0.1:4*pi;
subplot(2, 2, 1); plot(x, sin(x));
% 此为左上角图形
subplot(2, 2, 2); plot(x, cos(x));
% 此为右上角图形
subplot(2, 2, 3); plot(x, sin(x).*exp(-x/5));
% 此为左下角图形
subplot(2, 2, 4); plot(x, x.^2);
% 此为右下角图形
_BBCODE_CODE:
%同时画出四个图於一个视窗中
x = 0:0.1:4*pi;
subplot(2, 2, 1); plot(x, sin(x)); % 此为左上角图形
subplot(2, 2, 2); plot(x, cos(x)); % 此为右上角图形
subplot(2, 2, 3); plot(x, sin(x).*exp(-x/5)); % 此为左下角图形
subplot(2, 2, 4); plot(x, x.^2); % 此为右下角图形
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
|
Back to top
smirnoff ( )
|
Back to top
smirnoff ( )
Posted: 2014-2-15 04:52
MATLAB 仿真电路
www.mathworks.com/help...#f10-57148
>> R1 = 20e3;
C1 = 235e-9;
R2 = 2e3;
C2 = 22e-9;
num = [2*R2*C1 0];
den = [C1*R1*C2*R2*2 (2*C1*R1 + C2*2*R2) 2];
g = tf(num,den);
P = bodeoptions; % Set phase visiblity to off and frequency units to Hz in options
P.FreqUnits = 'Hz'; % Create plot with the options specified by P
bode(g,P); grid on
%[num,den] = eqtflength(num,den); % Make lengths equal
%[z,p,k] = tf2zp(num,den) % Obtain zero-pole-gain form
_BBCODE_CODE:
>> R1 = 20e3;
C1 = 235e-9;
R2 = 2e3;
C2 = 22e-9;
num = [2*R2*C1 0];
den = [C1*R1*C2*R2*2 (2*C1*R1 + C2*2*R2) 2];
g = tf(num,den);
P = bodeoptions; % Set phase visiblity to off and frequency units to Hz in options
P.FreqUnits = 'Hz'; % Create plot with the options specified by P
bode(g,P); grid on
%[num,den] = eqtflength(num,den); % Make lengths equal
%[z,p,k] = tf2zp(num,den) % Obtain zero-pole-gain form
ref:
electronics.stackexcha...ing-matlab
see also:
PSPICE and MATLAB for Electronics: An Integrated Approach, Second Edition
By John Okyere Attia
_________________ 隐藏内容为个人学习笔记
上一次由smirnoff于2046-12-25 8:39am修改,总共修改了7次
|
Back to top
smirnoff ( )
|
Back to top
移民生活北美论坛 Forum Index
-> 电子电玩
All times are GMT - 8 Hours
Page 1 of 2
Goto page: 1 , 2 Next
注:以上论坛所有发言仅代表发帖者个人观点, 并不代表本站观点或立场, 加西网对此不负任何责任。 投资理财及买房卖房版面的帖子不构成投资建议。投资有风险,责任请自负 对二手买卖中的虚假信息,买卖中的纠纷等均与本站无关。
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
Jump to:
选择一个论坛
焦点板块
加西知乎
发布求助
买房卖房
美丽的菲沙河谷
地产投资
加西菜园
商海微澜
租房那些事儿
加国一家亲
咱们本拿比
温哥华不眠夜
日月当空
休闲Langley
菩提树下
神爱世人
素里新家园
白石华人
歌声响起
读书沙龙
单身情缘
新时代之光
欢迎来新西敏
我爱列治文
高贵林的朋友们
中英双语班在Walton Elementary
生活互助
法律探索
医疗健康
准备养老
佛道净土.中医养生
天下收藏
减肥
投资理财
亲子教育
猪宝宝俱乐部
汽车天地
温村Jeep之家
钱币交流小站 (Coin Community)
免费个人广告
会员之家
北美盾之家
流协
吃喝与玩乐
玩玩乐乐
加西群英游艇会
结伴旅游
跳舞俱乐部
北美Hiking
吃吃喝喝
社团之窗
南粤茶居
交通大学校友会
福建同乡在此聚集
加拿大四川同乡联谊会
同济大学温哥华校友会
精彩贴图
精彩连环画
开心一笑
国家与城市
新闻时评
军事天地
教师罢工
大温市选
情系中国
绵绵乡音
香港占中
岭南人家
悠悠华夏
只刚上海话
西雅图夜未央
爱好与沙龙
原创原地
摄影交流
白石镇摄影交流
视听世界
疯人院 - 你的喜鹊巢
电子电玩
Twitter 交流
苹果乐园
android的星空
无限手机计划
部落冲突
大数据论坛
网站建设
颠覆小组—LINUX
IT人生
iTalkBB讨论组
English Corner
生活与教育
美好家居
精致生活
移民资讯
温哥华留学
宠物乐园
致富与创业
精明消费
炫彩珠宝
南下购物
创业沙龙
职场风云
运动与休闲
羽毛球场
高尔夫俱乐部
休闲运动
加西滑雪俱乐部
加西游泳俱乐部
武术之家
国家台球事务办公室
加西围棋俱乐部
网球天地
痴迷足球
乒乓球场
年青人天地
周末娱乐
美酒咖啡
彩妆
西餐美食
温哥华高尔夫
smirnoff, smirnoff, smirnoff, smirnoff, smirnoff, smirnoff, smirnoff, smirnoff, smirnoff, smirnoff