When I run the program, it should ask for values of m, y/b ratio. I can provide y/b value as 0.15, 0.23... which the program needs to interpolate and display the answer. Is it possible to create such program?

 채택된 답변

Jon
Jon 2019년 10월 7일

0 개 추천

If you type doc readmatrix on the command line you will get all the documentation, including examples for using this function. You can also google MATLAB readmatrix.
SImilarly if you look at the documentation for interp2 it will give you examples.
If once you have done this and put together an initial code to try out your ideas and you are still stuck then please attach the code and describe the specific problems you are having.

댓글 수: 8

Hitesh Bugata
Hitesh Bugata 2019년 10월 7일
Sure. Thanks!
Hitesh Bugata
Hitesh Bugata 2019년 10월 8일
column=3;
data = readmatrix('sheetdata.xlsx');
a=data(3:end,1);
v=data(3:end,column);
temp=interp1(v,a,j);
Jon
Jon 2019년 10월 8일
Do you have a question or a problem running your code?
If you are getting errors, that you have questions about, please copy and paste the full error message so others can see it.
Also, you can use the code button on the Matlab Answers toolbar to format you code nicely.
Hitesh Bugata
Hitesh Bugata 2019년 10월 8일
My problem got resolved. I used that code it worked. Pardon me for not mentioning that my issue got resolved. Thank you for your support!
Jon
Jon 2019년 10월 8일
Glad to hear you were able to get your program running. If this has answered your question please "accept" the answer
Jon
Jon 2019년 10월 8일
편집: Jon 2019년 10월 8일
I'm glad to hear you got your program running. If this answered your question, please "accept" the answer.
Hitesh Bugata
Hitesh Bugata 2019년 10월 8일
I should mention that I've used interp1 and not interp2.
Jon
Jon 2019년 10월 8일
Oh OK. From your initial problem description I thought you were interpolating over the rows and columns of the table thus interp2. I can understand if you are selecting just one column from the table and are interpolating over the rows of that column it makes sense to use interp1

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

추가 답변 (1개)

Jon
Jon 2019년 10월 7일

0 개 추천

You can use readmatrix to get the data out of the spreadsheet.
You can use interp2 to do the interpolation.

댓글 수: 1

Hitesh Bugata
Hitesh Bugata 2019년 10월 7일
May I get a sample code on how it looks? It would clarify many of my doubts. Thank you!

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

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

태그

질문:

2019년 10월 7일

댓글:

Jon
2019년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by