
Matlab
CHEN_BR
这个作者很懒,什么都没留下…
展开
-
圆形断面临界水深
% -- 计算 抛物线 形渠道的 临界水深计算clc; clear allbeta=0.001:0.01:10; % 无量纲参数的取值范围 β=αQ/b^2.5;g=9.81; % 重力加速度Mk=8*(1/g*beta.^2).^(1/3); hk025=0.207*(Mk).^0.7704; % 单位 m;plot(beta,hk025,'b-','linewidth',2); hold on axis([0.001,3,0.01,1]) xlabel('无量纲.原创 2021-02-10 15:52:41 · 405 阅读 · 0 评论 -
梯形断面临界水深莫洛图
% -- 计算梯形渠道的 临界水深计算clc; clear allbeta=0.01:0.01:1000; % 无量纲参数的取值范围 β=αQ/b^2.5;g=9.81; % 重力加速度 % plot(lam,entak0,'k-','linewidth',2); hold on% 迭代一次% plot(lam,entak1,'r-','linewidth',2); hold on % 当 m=0 时; 矩形hk00=(1/g*beta.^2).^(1/3);plot(beta.原创 2021-02-10 15:50:54 · 487 阅读 · 0 评论 -
三角形临界水深
% -- 计算 三角形 形渠道的 临界水深计算clc; clear allbeta=0.01:0.01:1000; % 无量纲参数的取值范围 β=αQ/b^2.5;g=9.81; % 重力加速度 Q=beta*g^0.5; % 当 m=0.5 时; m=0.5;hk05=(2*beta.^2/m/m).^0.2; % 单位 m;plot(Q,hk05,'k-','linewidth',2); hold on % 当 m=1 时; m=1;hk10=(2*beta.^2/m/.原创 2021-02-10 15:50:08 · 420 阅读 · 0 评论 -
抛物线断面临界水深莫洛图
% -- 计算 抛物线 形渠道的 临界水深计算clc; clear allbeta=0.01:0.01:1000; % 无量纲参数的取值范围 β=αQ/b^2.5;g=9.81; % 重力加速度 Q=beta*g^0.5; % 当 m=0.5 时; m=0.25;hk025=(27/64*beta.^2/m).^0.25; % 单位 m;plot(Q,hk025,'b-','linewidth',2); hold on % 当 m=0.5 时; m=0.5;hk05=(.原创 2021-02-10 15:49:12 · 278 阅读 · 0 评论 -
圆形断面正常水深莫洛图
% -- 计算 抛物线 形渠道的 正常水深计算clc; clear allM0=0.001:0.01:8; % 无量纲参数的取值范围 β=αQ/b^2.5;g=9.81; % 重力加速度h0=(0.0104+0.3356*M0) ./(1+0.3732*M0-0.0962*M0.^2); beta=(M0/(2^2.6)).^(1/0.6); plot(beta,h0,'b-','linewidth',2); hold on axis([0.001,0.4,0.01,1]).原创 2021-02-10 15:47:36 · 295 阅读 · 0 评论 -
梯形断面正常水深莫洛图
% -- 计算梯形渠道的 正常水深计算clc; clear allh0=0.001:0.01:20; % 无量纲参数的取值范围 β=αQ/b^2.5;g=9.81; % 重力加速度 % plot(lam,entak0,'k-','linewidth',2); hold on% 迭代一次% plot(lam,entak1,'r-','linewidth',2); hold on % 当 m=0 时; 矩形beta=h0.^(5/3)./(1+2*h0).^(2/3) ;plot(.原创 2021-02-10 15:46:09 · 771 阅读 · 0 评论 -
核密度估计
具体原理及定义:传送门https://en.wikipedia.org/wiki/Density_estimationMATLAB 代码实现如下: 1 % Kernel Density Estimation 2 % 只能处理正半轴密度 3 function [t, y_true, tt, y_KDE] = KernelDensityEstimation(x) 4 % clear 5 6 % x = px_last; 7 % x = px_last_tu; 8 %% 9 %参数初.原创 2021-01-05 21:01:50 · 955 阅读 · 0 评论 -
matlab_cheatsheet
% make the cheatsheet for matlab% by : Peijinclear;clc;close allvis_ax = 'on';ftsz=0.85;fig_size = 800;fig_0 = figure('color','w','position',[0, 0, fig_size*1.414,fig_size]);set(fig_0,'renderer','Painters')% mainax_header = axes('position',[0...原创 2020-12-04 20:09:11 · 428 阅读 · 0 评论 -
water_level_plot.m
Plotting program x = 1:1:10000; x1 = CumHOH_jaar_rot_orig; y1 = Levels_orig; x2 = PDF; y2 = v; hold on hl1 = scatter(x1,y1,'.r'); hold on; ax1 = gca; set(ax1,'XColor','k','YColor','k') ax2 = axes('Position',get(ax1,'Position'),'XAxisLocatio.原创 2020-12-02 13:00:15 · 250 阅读 · 0 评论 -
water_level.m
clear all; clc; figure(1), clf; data = load('waterstand_HOH.txt'); % loading water levels afmeting = size(data); som = afmeting(:,1); % size of the dataset replace = true; % Bootstrap with replacing jaar = 98; % Numbe.原创 2020-12-02 12:59:35 · 331 阅读 · 0 评论 -
横坐标
ax1.XAxis.MinorTick='on';ax1.XAxis.MinorTickValues=[256789];原创 2020-12-01 13:03:21 · 304 阅读 · 0 评论 -
Mapping Toolbox 1
worldmap worldload coastlineswhos[latcells, loncells] = polysplit(coastlat, coastlon);numel(latcells)plotm(coastlat, coastlon)原创 2020-11-22 19:21:02 · 358 阅读 · 1 评论 -
Mapping Toolbox 2
h = worldmap('Europe');getm(h,'MapProjection')geoshow('landareas.shp', 'FaceColor', [0.15 0.5 0.15])geoshow('worldlakes.shp', 'FaceColor', 'cyan')geoshow('worldrivers.shp', 'Color', 'blue')geoshow('worldcities.shp', 'Marker', '.',... .原创 2020-11-22 19:19:46 · 556 阅读 · 0 评论 -
matlab里如何实现每循环一次就把结果保存到一个新矩阵里?
每次循环产生一个一维的矩阵,希望把每次循环产生的结果依次写入一个新矩阵中,一次结果占一行。怎样创建新矩阵?怎么实现新结果不会覆盖原来的?我是初学者,求大神指教~ a = zeros(10,5);for i = 1:10 ... a(i,:) = ...endhttp://www.ilovematlab.com/thread-269562-1-1.html...原创 2020-11-18 23:30:26 · 29631 阅读 · 8 评论 -
三维条形图和折线图
close all;clc;clear allf=gcf;f.Color='w';%=====================这里是绘图,数据是随意的Z=6+4*rand(10,1);Y=2+8*rand(10,1);BarHandle=bar3([1:10],Z,0.7);hold onLineHandel=plot(Y,[1:10],'Color',[0 0 0],'LineWidth',1);PointHandel=plot(Y,[1:10],'o','MarkerFaceCo...原创 2020-11-13 21:16:24 · 482 阅读 · 0 评论 -
生成潮位矩阵数据
clear;clcfor k=1:1:15 %% 此处的15记得修改,15个开边界点filename=sprintf("data_%d.mat",k);load(filename);Tidal(:,k)=TimeSeries(1,:);end%%输出fid=fopen("Elevation.dat","wt");[p,q] = size(Tidal)for i=1:1:p for j=1:1:q if j==q fprintf(fi.原创 2020-10-15 14:58:13 · 591 阅读 · 0 评论 -
检查潮差
ncdisp('hzw_station_timeseries.nc','/', 'full');data=ncread('hzw_station_timeseries.nc','zeta');原创 2020-10-03 19:09:01 · 358 阅读 · 0 评论 -
fvcom-toolbox前处理matlab程序问题
在windows7下运行了fvcom-toolbox文件夹下fvcom_prepro里面的前处理程序的example.m。程序可以运行但是在调研write_FVCOM_river.m函数时,里面有个netcdf命令。% open boundary forcingnc = netcdf(RiverFile, 'clobber');nc.type = 'FVCOM RIVER FORCING FILE' ;nc.title = RiverInfo1;nc.info = RiverInfo2;nc.h原创 2020-08-29 16:44:01 · 985 阅读 · 0 评论 -
inpolygon
inpolygon True for points inside or on a polygonal region. IN = inpolygon(X,Y,XV,YV) returns a matrix IN the size of X and Y. IN(p,q) = 1 if the point (X(p,q), Y(p,q)) is either strictly inside or on the edge of the polygonal region whose verti...原创 2020-08-24 19:50:00 · 333 阅读 · 0 评论 -
>> help inpoly
>> help inpoly inpoly: Point-in-polygon testing. Determine whether a series of points lie within the bounds of a polygon in the 2D plane. General non-convex, multiply-connected polygonal regions can be handled. SHORT SYNTAX: in =...原创 2020-08-24 19:48:32 · 141 阅读 · 0 评论 -
‘String match to name in use (NC_ENAMEINUSE)‘。
错误使用 netcdflibNetCDF 库在执行 'defVar' 函数期间遇到错误 - 'String match to name in use (NC_ENAMEINUSE)'。出错 netcdf.defVar (line 45)varid = netcdflib('defVar', ncid, varname, xtype, dimids);原创 2020-08-23 20:37:40 · 1818 阅读 · 3 评论 -
错误记录
>> wrf2fvcom_U10V10错误: 文件:wrf2fvcom_U10V10.m 行:7 列:20不应为 MATLAB 表达式。修改:第七行乱入字符了,删掉就可以了。>> wrf2fvcom_U10V10未定义函数或变量 'netcdf'。出错 wrf2fvcom_U10V10 (line 18)nc = netcdf(wrf_file);修改:https://blog.youkuaiyun.com/Theo93/article/details..原创 2020-08-09 15:02:01 · 371 阅读 · 0 评论 -
nctoolbox—matlab错误
错误如下:未定义函数或变量 'setup_nctoolbox'。出错 CFStoFORT22 (line 6)setup_nctoolbox原创 2020-07-27 12:48:46 · 1512 阅读 · 0 评论