fcode 发表于 2018-8-10 10:29 嗯嗯,谢谢您!少了很多错误,还剩下点我再调调 |
第一个错误是 #Bad preprocessor line 这说明你需要开启 预处理。 项目(工程,Project)菜单,属性,Fortran(展开),Preprocessor,Preprocessor Source File,Yes |
输出窗口提示请给更多一些。 注意 <fintrf.h> 文件是什么格式?如果是自由格式,则源代码也要是自由格式。如果是固定格式,则源代码也要是固定格式。 |
fcode 发表于 2018-8-9 14:47 提示错误的代码区域如下: #include <fintrf.h> C C C This subroutine is the main gateway to MATLAB. When a MEX function C is executed MATLAB calls the MEXFUNCTION subroutine in the corresponding C MEX file. C C C Gateway routine subroutine mexFunction(nlhs, plhs, nrhs, prhs) C Declarations implicit none C----------------------------------------------------------------------- C mexFunction arguments: mwPointer plhs(*), prhs(*) integer nlhs, nrhs C----------------------------------------------------------------------- C Function declarations: mwPointer mxGetPr mwPointer mxCreateDoubleMatrix integer mxIsNumeric mwPointer mxGetM, mxGetN C----------------------------------------------------------------------- C Pointers to input/output mxArrays: mwPointer x_ptr_LLH, x_ptr_YMDH, y_ptr C----------------------------------------------------------------------- C Array information: mwPointer mrows1, ncols1, mrows2, ncols2 mwSize size1, size2 C----------------------------------------------------------------------- C Arguments for computational routine: integer*4 x_input_YMDH !TIME real*8 x_input_LLH, y_output !LATITUDE LONGITUDE HEIGHT OTUPUT C----------------------------------------------------------------------- C Get the size of the input array. mrows1 = mxGetM(prhs(1)) ncols1 = mxGetN(prhs(1)) size1 = mrows1*ncols1 mrows2 = mxGetM(prhs(2)) ncols2 = mxGetN(prhs(2)) size2 = mrows2*ncols2 C Create Fortran array from the input argument. x_ptr_LLH = mxGetPr(prhs(1)) call mxCopyPtrToReal8(x_ptr_LLH,x_input_LLH,size1) x_ptr_YMDH = mxGetPr(prhs(2)) call mxCopyPtrToInteger4(x_ptr_YMDH,x_input_YMDH,size2) C Create matrix for the return argument. plhs(1) = mxCreateDoubleMatrix(1,20,0) y_ptr = mxGetPr(plhs(1)) C Call the computational subroutine. call Ionosphere(y_output, x_input_LLH, x_input_YMDH) C Load the data into y_ptr, which is the output to MATLAB. call mxCopyReal8ToPtr(y_output,y_ptr,20) return end 计算子程序名称为: C----------------------------------------------------------------------- C Computational routine subroutine Ionosphere(y_output, x_input_LLH, x_input_YMDH) 输出窗口重要提示为: remark #8290: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+3'. |
请给出必要的代码。 “输出窗口”的内容,复制粘贴。(不要看“错误列表”窗口) |
捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )
GMT+8, 2025-4-19 16:33