필터 지우기
필터 지우기

how can I define an excel woorksheet in Matlab that consider the location of cells with equal numeric value and change them into specific values that I want.

조회 수: 2 (최근 30일)
how can I define an excel worksheet in Matlab that consider the location of cells with equal numeric values and change them into specific values that I want. in other word I want : Region 1 = locations of all cells with numerical values of A Region 2 = locations of all cells with numeric value of B And so on. and then change each region to specific values that I want. and repeat it and each time changing region s first value to specific values, as many times that I want . each region has so many cells therefor I cant define them cell by cells in matlab.

채택된 답변

dpb
dpb 2014년 3월 16일
It's so trivial in Matlab; just import the array; make the changes and rewrite (assuming you must use Excel at all; why can't you just use Matlab?)
data=xlsread('yourfile.xls');
data(data==A)=newA;
data(data==B)=newB;
xlswrite('yourfile.xls',data)
You may have the problem depending on the values addressed in the FAQ--
  댓글 수: 13
baran
baran 2014년 3월 18일
thanks so much , if "A" has value , for example all cells with value 2 , that when excel link to matlab "2" go to functions and change to another value and 2 in my program is a number and it is not symbol, then is it still true ? and what do you mean " if firstflag ..." can you explain more ? thanks.
dpb
dpb 2014년 3월 18일
I don't know about how you're doing the "Excel link to Matlab" specifically, but certainly you'll have to fix any issue of whether the value passed is the character representation (a string/character variable) or the value itself. That should be relatively simple to deal with.
The "firstflg" is a variable you set to know whether the index array needs to be updated or whether to use the previously computed one. It's a local variable to Matlab controlled by whoever is in charge of the overall process which you've yet to describe how this whole thing is structured.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by