reading from txt file and using repmat for single column of the matrix

2 ビュー (過去 30 日間)
Ram
Ram 2011 年 8 月 24 日
I have a dataset that has columns A and B separated by tab. I need to do the following: 1. Read the txt file using Uigetfile. 2. Remove the first 4 lines and last 10 lines from the dataset. 3. Repmat column 2, 10 times so that the new dataset will have 11 columns. 4. Write the new dataset into a file.
thanks for inputs.

回答 (2 件)

Ram
Ram 2011 年 8 月 24 日
I have been able to read the file (not using Uigetfile) but hardcoded in the fopen command. Once i read the file and when using repmat I am not able to replicate the column B, but instead the 2nd datapoint gets replicated.

Walter Roberson
Walter Roberson 2011 年 8 月 24 日
YourData(:,3:11) = repmat(YourData(:,2),1,10));

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by