필터 지우기
필터 지우기

Variable for range in xlswrite

조회 수: 1 (최근 30일)
Alexandros
Alexandros 2011년 11월 18일
I have define a variable which is beeing calculated automaticaly.
This variable has been define
a = [starcell ':', endcell]
and it give me e.g.
a = g12: h12
Now when i write
xlswrite('1.xls', Y, 3, a) it doesn't want to understand the range. The variable a is a character string . Does anybody have any idea?

채택된 답변

Sven
Sven 2011년 11월 18일
Providing a variable as a string should be exactly the same as providing that string directly. Here are 3 possibilities that I can think of:
1. Did you intend to have the space " " character in the string "g12: h12". Try it without the space.
2. Make sure that the variable Y matches exactly the size you defined with g12:h12 (ie, it's 1-by-2)
3. Try uppercase 'G12:H12'
  댓글 수: 1
Alexandros
Alexandros 2011년 11월 18일
Yes I fixed it. It was the space between the g12: h12.
My function i made to find the cells i need to put them was automatically putting a space between them. I took it out and work fine

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by