필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I edit this code ?

조회 수: 1 (최근 30일)
ND
ND 2015년 11월 30일
마감: MATLAB Answer Bot 2021년 8월 20일
Please I have this code
% code
ex = dlmread( 'BB.txt' ) ; %output data
S11 = dlmread( 'AA.txt' ) ; % input data
buffer = [S11,ex] ;
[~, ca] = unique( buffer, 'rows' ) ;
buffer = buffer(sort(ca),:) ;
Mshuffled = buffer(randperm(size(buffer,1)),:);
x1Range= 'B';
xlswrite( 'first.xlsx', [{'S11'}; num2cell( Mshuffled(:,1) )], 'X',x1Range) ;
xlswrite( 'first.xlsx', [{'E11'}; num2cell( Mshuffled(:,2) )], 'Y' ) ;
I need to multiply the data in (ex.txt) by 10^4 . So all rows in E11 column will be multiplied by this factor. Is that possible?
Many thanks

답변 (1개)

Image Analyst
Image Analyst 2015년 11월 30일
Yes, but first you need to call dlmread('ex.txt') which you have not done yet. You've only read in AA.txt and BB.txt.
exData = dlmread( 'ex.txt'); % Input data
Next, I don't know what the "E11" column is. Columns have only letters, not letters and numbers. Do you mean the column that cell E11 is in, which, of course, is column "E" (column 5)? If so then:
% Multiply column 5 by 10^4
exData(:, 5) = exData(:, 5) * 10000;

Community Treasure Hunt

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

Start Hunting!

Translated by