这是结构的设置方式:
ClimateSubtractStruct = struct('net',NetClimatologySubtracted,'SW',SWClimatologySubtracted,'LW',LWClimatologySubtracted,'SWCF',SWCFClimatologySubtracted,'LWCF',LWCFClimatologySubtracted,'netclear',netclearClimatologySubtracted,'LWclear',LWclearClimatologySubtracted,'SWclear',SWclearClimatologySubtracted,'Clouds',TotalCloudForcingClimatologySubtracted, 'Precip',PrecipClimatologySubtracted);
fields = fieldnames(ClimateSubtractStruct);
然后我调用GlobalCorrMap(它使用输入名作为图的标题和文件名的参数)。然后我打算使用for循环运行GlobalCorrMap来比较和绘制结构中每个变量之间的相关性。下面是一个示例参数:
GlobalCorrMap(ClimateSubtractStruct.(fields{1}),ClimateSubtractStruct.(fields{3}))
我想知道 - inputname是否可以获取在结构中调用的变量的变量名?或者我只是简单地重命名函数,以便它可以将两个变量的名称作为两个单独的参数?