MATLAB: Error using pdbread (line 78)

pdbfile

hello there
i write a function according to this:
A. Write a function for selecting and reading a pdb file.
i (The function does not receive input.
ii (Output: Structure with fields corresponding to pdb format.
iii (The function works as follows:
(1 (Asking the user to select a file (uigetfile command with output of file name and folder name).
(2 (composes the full name of the file (including path space on disk) and reads it the output argument of the function.
the function is like this:
function kovetz= A()
[choseK,choseD]=uigetfile('*.ent','shemkovetz');
kovetz=pdbread([choseK,choseD,]);
end
but i have an error that says
Error using pdbread (line 78)
File does not exist or does not contain valid PDB data.
Error in A (line 3)
kovetz=pdbread([choseK,choseD,]);
What can I do to fix it??

Best Answer

kovetz = pdbread(fullfile(choseD,choseK));