将 matlab 内联命令转换为不同的
converting matlab inline command to different
我在 Matlab 中
工作,我编写了以下脚本,旨在导入到 Excel 中,但是当我运行 Matlab C++ Coder 时,它告诉我不支持我的内联命令。
function f = moody(ed,Re)
if Re<0
error(fprintf('Reynolds number = %f cannot be negative',Re));
elseif Re<2000
f = 64/Re; return % laminar flow
end
if ed>0.05
error(fprintf('epsilon/diameter ratio = %f is not on Moody chart',ed));
end
findf = inline('1.0/sqrt(f)+2.0*log10(ed/3.7+2.51/(Re*sqrt(f)))','f','ed','Re');
fi = 1/(1.8*log10(6.9/Re+(ed/3.7)^1.11))^2; % initial guess at f
dfTol = 5e-6;
f = fzero(findf,fi,optimset('TolX',dfTol,'Display','off'),ed,Re);`
如何使用匿名函数或 arrayfun 命令重写 findf = inline
命令,以便编译器正常工作?
findf = @(f,ed,Re( 1.0/sqrt(f(
(((
+2.0*log10(ed/3.7+2.51/(Re*sqrt(f
相关文章:
- 将图像魔术转换命令转换为魔术++c++代码
- 将命令行转换为从 Openssl 到 c++ 的代码
- 如何将带有 -F 选项的 curl 命令转换为 libcurl
- 链接从命令行转换为Make的库
- 如何在Magick++中编写这些“转换”命令
- 将编译器命令行转换为 CMakeLists.txt用于 Casablanca Rest SDK
- 将GCC命令转换为Android NDK的CMAKE
- 如何将Mongo Shell命令转换为Mongocxx语法
- 将 matlab 内联命令转换为不同的
- 有没有一种简单的方法可以将系统命令的输出转换为字符串
- 将命令行参数转换为qimage
- 将FFMPEG命令行转换为C 编解码器设置
- 来自Magick++的形态,以匹配命令行转换
- 通过 see 命令引用转换运算符
- 将多行外壳脚本转换为一行命令
- C ++如何将我的命令行参数(MAC地址)转换为无符号字符
- 将命令行参数程序转换为菜单驱动程序
- 保存命令行参数并对其进行类型转换
- 将命令行参数解析/转换为不同类型
- Gstreamer语言 - 转换命令行gst-launch到C代码