GetGraphData_jd

PURPOSE ^

SYNOPSIS ^

function [x,y,z,xlab,ylab,zlab,warnstr] = GetGraphData_jd(handles, graph);

DESCRIPTION ^

 This function retrieves the data from a given scenario and graph type and
 sends the data as a (x,y) or (x,y,z) group.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [x,y,z,xlab,ylab,zlab,warnstr] = GetGraphData_jd(handles, graph);
0002 %
0003 % This function retrieves the data from a given scenario and graph type and
0004 % sends the data as a (x,y) or (x,y,z) group.
0005 %
0006 x = [];
0007 y = [];
0008 z = [];
0009 xlab = '';
0010 ylab = '';
0011 zlab = '';
0012 warnstr = [];
0013 %
0014 load(graph.scenario,'graphs')
0015 %
0016 if exist('graphs','var'),
0017     %
0018     NumberOfGraphs = length(graphs);
0019     %
0020     for igraph = 1:NumberOfGraphs
0021         if isequal(graphs{igraph}.type,graph.type),
0022             x = graphs{igraph}.x;
0023             y = graphs{igraph}.y;
0024             z = graphs{igraph}.z;
0025             xlab = graphs{igraph}.xlab;
0026             ylab = graphs{igraph}.ylab;
0027             zlab = graphs{igraph}.zlab;
0028             return
0029         end
0030     end
0031 else
0032     NumberOfGraphs = 0;
0033 end
0034 %
0035 if isequal(graph.type,handles.listofgraphtypes{1}),% xte
0036     %
0037     load(graph.scenario,'equil');
0038     x = psi2rho_jd(equil,equil.ppsi/equil.ppsi(length(equil.ppsi)));
0039     y = equil.pTe;
0040     z = [];
0041     xlab = '\rho';
0042     ylab = 'T_e';
0043     zlab = '';
0044     %
0045 end
0046 %
0047 if isequal(graph.type,handles.listofgraphtypes{2}),% xne
0048     %
0049     load(graph.scenario,'equil');
0050     x = psi2rho_jd(equil,equil.ppsi/equil.ppsi(length(equil.ppsi)));
0051     y = equil.pne;
0052     z = [];
0053     xlab = '\rho';
0054     ylab = 'n_e';
0055     zlab = '';
0056     %
0057 end
0058 %
0059 graphs{NumberOfGraphs + 1}.type = graph.type;
0060 graphs{NumberOfGraphs + 1}.x = x;
0061 graphs{NumberOfGraphs + 1}.y = y;
0062 graphs{NumberOfGraphs + 1}.z = z;
0063 graphs{NumberOfGraphs + 1}.xlab = xlab;
0064 graphs{NumberOfGraphs + 1}.ylab = ylab;
0065 graphs{NumberOfGraphs + 1}.zlab = zlab;
0066 %
0067 save(graph.scenario,'graphs','-append')

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.