필터 지우기
필터 지우기

webread with variable in url

조회 수: 3 (최근 30일)
ozcan
ozcan 2016년 10월 5일
답변: ozcan 2016년 10월 5일
I am calculating route of between two points and my code is
url= ['https://www.google.com/maps/dir/40.99311533,29.06124115/41.04388643, 28.90537262/am=d/'] above codes works but when I want to an iterate calculation codes have to read Latitude and Longitude values from another matrice . I am getting Error
A=[40.99311533 29.06124115] B=[41.04388643, 28.90537262] How can Write the matrice values into above codes ? I tried url= ['https://www.google.com/maps/dir/A(1),A(2)/41.04388643, 28.90537262/am=d/'] it dosnt work

채택된 답변

ozcan
ozcan 2016년 10월 5일
it works, great Thanks Jan Simon

추가 답변 (1개)

Jan
Jan 2016년 10월 5일
편집: Jan 2016년 10월 5일
Your code inserts the "A(1)" as string, not the value of the variable. How should Matlab guess, that the variable is meant?
A = [40.99311533 29.06124115];
B = [41.04388643, 28.90537262];
url = sprintf('https://www.google.com/maps/dir/%.12g,%.12g/%.12g,%.12g/am=d/', ...
A, B);
See:
doc sprintf

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by