필터 지우기
필터 지우기

Merge two arrays one after each other by elemnets

조회 수: 1 (최근 30일)
H R
H R 2017년 3월 31일
답변: KSSV 2017년 3월 31일
I have an array a1=[1 2 3 4 ... 50] I also have string '*GOAL'
I want to create a single string B that can produce:
*GOAL 1
*GOAL 2
*GOAL 3
*GOAL 4
*GOAL 5
...
I want to use this string B and replace a character [$1] that is inside a text file 'Goals.txt'.

채택된 답변

KSSV
KSSV 2017년 3월 31일
str1 = 'GOAL ' ;
idx = 1:50 ;
str1 = repmat(str1,length(idx),1) ;
iwant = [str1,num2str(idx')]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by