how can i use variables as part of a address?

조회 수: 1 (최근 30일)
rad sel
rad sel 2020년 1월 5일
댓글: rad sel 2020년 1월 5일
im reading an excel file that include some parts of addresses .and i have to Connect the addresses in excel file to the main address. and then use the final address to get the related file. for example Network/sharefolder/p426/the address that was in excel cell/BOM/the file name that was in excel cell
im reading the address and name from excel file but i dont know how to put them to gather and creat the final address

채택된 답변

awezmm
awezmm 2020년 1월 5일
You can use the fullfile function to build a path from different parts:
finalAddress = fullfile('Network/sharefolder/p426/','/BOM/','myfile.m')
  댓글 수: 2
Stephen23
Stephen23 2020년 1월 5일
Really one of the main advantages to using fullfile is that it automatically handles the path separator character. So to make use of fullfile's functionality, use this:
fnm = fullfile('Network/sharefolder/p426',addressFromExcel,'BOM',fileFromExcel)
rad sel
rad sel 2020년 1월 5일
thank you very much <3
it worked correctly.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by