필터 지우기
필터 지우기

How to write matrix to text with comma separate but first column should be string

조회 수: 2 (최근 30일)
i have a matrix with four columns. all values are numbers.I want to write it on text with comma separate row by row.but first column should be string after writing.how to do it?please help me. thanks! I used dlmwrite to write and Also I attached a text document with question

답변 (1개)

Ingrid
Ingrid 2014년 9월 4일
You can use sprintf to specify the type of output you want to write (%s for strings and %f for floats) and num2str to convert your number of the first column to a string

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by