The issue happened at line 32 in pspm_display. This is a line that is iteratively used when pspm_display is running. Initially, the varargin is set to be the input of pspm_display. In default, varargin is empty, so the line is not actually executed. In the next iteration, varargin becomes a multi-cell cell array, which is when nargin is no longer 0. This will not consider the situation that pspm_display actually has an input.
I am not fully clear what gui_State.gui_Callback is used for, since it is not really called much in this function. Therefore, I set a situation to identify whether it is processing the user's input as varargin, and this situation is determined in line 38 of the new version.
Changes proposed in this pull request:
This pull request updates the checking of input variable for display. If the varargin{1} refers to user's input, as a file name or a file path, it will no longer call str2func. The situation for determining the input is a file name or a file path is that the varargin{1} ends with .mat.
Fixes #718
Cause of the issue
The issue happened at line 32 in
pspm_display
. This is a line that is iteratively used whenpspm_display
is running. Initially, thevarargin
is set to be the input ofpspm_display
. In default,varargin
is empty, so the line is not actually executed. In the next iteration,varargin
becomes a multi-cell cell array, which is whennargin
is no longer 0. This will not consider the situation thatpspm_display
actually has an input. I am not fully clear whatgui_State.gui_Callback
is used for, since it is not really called much in this function. Therefore, I set a situation to identify whether it is processing the user's input asvarargin
, and this situation is determined in line 38 of the new version.Changes proposed in this pull request:
varargin{1}
refers to user's input, as a file name or a file path, it will no longer callstr2func
. The situation for determining the input is a file name or a file path is that thevarargin{1}
ends with.mat
.