I would like to extract x,y,z coordinates of any 3 atoms from a pdb file. How to rectify this error and make it generalized?

조회 수: 5 (최근 30일)
ubq=getpdb('1UBQ');
for n=[1,2,3]
Q(n)=[ubq.Model.Atom(n).X, ubq.Model.Atom(n).Y, ubq.Model.Atom(n).Z]
end
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

채택된 답변

Walter Roberson
Walter Roberson 2023년 1월 28일
% N = range of indices for example
N=1:7;
Q = [ubq.Model.Atom(N).X; ubq.Model.Atom(N).Y; ubq.Model.Atom(n).Z].';
This assumes that each X Y Z are scalars.
This code process an array with 3 columns. If 3 rows are acceptable then leave out the .'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bioinformatics Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by