logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

2022年圣诞节 | matlab实现炫酷的圣诞树

这段代码是一个生成3D圣诞树的Matlab函数。运行该函数时,它使用圆柱函数创建圣诞树的 3D 表面,对树冠应用随机扰动,并使用 surfl 函数绘制树。树以当前轴 (gca) 绘制,并为绘图指定颜色图和照明。该函数还在树的顶部绘制一颗星星,并创建白色圆圈的散点图来表示树上的灯光。最后,该函数使用 lightFuncX 和 lightFuncY 函数在树上绘制其他光源,这些函数在代码前面已定义。该

文章图片
#matlab#开发语言
matlab 中histogram,hist的用法

x = randn(1000,1);edges = [-10 -2:0.25:2 10];h = histogram(x,edges);这是指定区间的;第一个是-10,2histogram参考链接hist是用区间的作为直方图的中心hist参考链接

#matlab
matlab 绘制置信范围_fill(绘制其区间形成的区域)

%使用 fill 函数绘制置信范围,同时使用 plot 函数绘制数据点,以此方式创建含有置信范围的绘图x= 0:0.2:10;y = besselj(0, x);%贝塞尔函数xconf = [x x(end:-1:1)] ;%一个来回;2列数yconf = [y+0.15 y(end:-1:1)-0.15];%0.15就是条带宽度,换成矩阵就会有不同的宽度%xconf第二列不变,但yconf会减0

#matlab
matlab ncwrite需要注意纬度

写入1维肯定没有问题二维变量创建是倒过来创建的nccrate;ncwrite写入时需注意转置,或者注意将变量倒转三维变量不能转置,只能通过倒转的方式ncwrite

#matlab
matlab中的regress函数总结

clccleardata=xlsread('ty_num.xlsx');%第三列是全区;第四列是偶极子data1=xlsread('w_E.xlsx');%第一列是w,第二列是东%设置x的值,第1列全为1x(:,2)=data(:,1);x(:,1)=1;y=data1(:,3);[b,bint,r,rint,stats]=regress(y,x);b的值为系数,b(1)为系数,b(2)为x前面的

#matlab
matlab sprintf函数的用法

%数值的格式化输出str_a=sprintf('%.5f',pi);%字符串的格式化输出str=sprintf('pi = %.5f',pi);%输出类型为charstr1=sprintf(string('pi = %.5f'),pi);%输出类型为stringteam1='Manchester United';team2='Chelsea';str2=sprintf('%s won %s,con

#matlab
matlab 批量注释(一次一次点%很麻烦)

方法有很多种:1.一种是选定后 ctrl+r 和ctrl+t 切换,前者是注释掉。后者是取消注释【推荐】2.一种是在段首加 if 0 ,段尾加 end,中间都不执行,也就相当于注释掉了。。。参考链接:https://blog.csdn.net/kobesdu/article/details/8703561...

#matlab
matlab m_map学习总结系列7

有个m_lldist很纠结%投影m_coast('patch',[.7 1 .7],'edgecolor','none');%大陆,无岸线m_grid('box','fancy','linestyle','-','gridcolor','w','backcolor',[.2 .65 1]);%外框cities={'Cairo','Washington','Buenos Aire...

#matlab
matlab m_map学习总结系列4

m_proj('lambert','lon',[-10 20],'lat',[33 48]);%投影[CS,CH]=m_etopo2('contourf',[-5000:500:0 250:250:3000],'edgecolor','none');%这个应该还要装etopo库,没有数据,是个难点问题m_grid('linestyle','none','tickdir','out','l...

#matlab
matlab m_map学习总结系列2

% Note that coastline is drawn OVER the grid because of the order in which% the two routines are called岸线画在网格上,画图讲究一个顺序m_proj('stereographic','lat',90,'long',30,'radius',25);%投影方式'stereographic',l...

#matlab
    共 59 条
  • 1
  • 2
  • 3
  • 6
  • 请选择