How do I input a variable into a string?

조회 수: 3 (최근 30일)
Jegor
Jegor 2024년 11월 11일
편집: Stephen23 2024년 11월 11일
I am currently working on a project that takes weather data and crates a histogramm based on it. Data is structured in an Excel notebook with every month's data being in it's own sheet. The code below shows how the programm calls the data from the Excel sheet and builds the histogramm. However, i am having trouble with calling data from specific rows from the sheet. I need to change the x'es in 'Bx:Yx' to the lv variable from my code. What are the ways of doing that?
lv=get(h_list,'Value')+1 %date
mv=d(get(h_popup,'Value')) %month
Assimuudid=readmatrix("Andmed.xlsx","Sheet",(mv),'Range','Bx:Yx') %the data
theta=Assimuudid
radio_ryhm_callback %function that creates the histogramm

채택된 답변

Stephen23
Stephen23 2024년 11월 11일
편집: Stephen23 2024년 11월 11일
lv = 3; % example value
"B"+lv+":Y"+lv
ans = "B3:Y3"
sprintf('B%u:Y%u',lv,lv)
ans = 'B3:Y3'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by