Adding Data to an Existing Nx1 Double
이전 댓글 표시
Hello everyone. I have a 257x1 double that I need to add zero values to at set locations without removing the pre-existing data, in essence expanding the double to a 264x1.
I've been searching through existing answers but am still not quite getting it due to most cases involving NxM matrices as opposed to having a single column.
Thanks for your help Conor
EDIT -------------- After some additional searching I found a method that solves my problem but I am still curious if it is the most efficient, here is my finished code:
U = ones (264,1);
U (:) = NaN;
U ([9;37;38;39;49;50;51]) = 0;
URLocations = find (isnan (U));
U (URLocations) = UR;
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!