How to specify points in on two curves in plot?

1 回表示 (過去 30 日間)
Mahdi Ghorbani
Mahdi Ghorbani 2021 年 1 月 6 日
コメント済み: Mahdi Ghorbani 2021 年 1 月 6 日
Hey guys. if my λ = 58.5 ( in x-axis), how can i get both different amounts of "σ cr" on those curves?
Also another question: Amounts in "σ cr" axis are seprated from each other (there's no interval between them. Same goes for λ axis. Both are imported from an excel file) How can i glue them togethor to get exact amounts of σcr for my λ = 58.2?
Sorry for my bad english and thank you for your time :)

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 1 月 6 日
This seems like a task for interp1. Have a look at the help and documentation for that function. I'd do something like this:
scr1_58.5 = interp1(lambda,sigmacr,58.5);
Should work for both the case where sigmacr is a 2-by-number-of-wavelength-samples and a similar 1-D array (then you'd have to repeat the operation for the other sigma.)
HTH
  1 件のコメント
Mahdi Ghorbani
Mahdi Ghorbani 2021 年 1 月 6 日
You sir just made my day! It worked. I tried interp1 before but it seems i didnt use it properly before. But your code worked perjectly fine. Thank you.
scr1_LandaT = interp1(Landa_t,stress_Vector_modified,Landa)
scr1_LandaR = interp1(Landa_r,stress_Vector_modified,Landa)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by