How to insert two variables into a sprintf string?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have created an fft plot of some data where the peaks are labeled with their values. Each peak indicates the order for. The first peak is first order, second is second order, and so on. I want the data label to say 1,2,3... order = peak value. All I can come up with is how to get order = value. How can I make it so that I can insert another variable into sprintf.
Here is what I have so far..
for ii=2:13
o=(ii-1)
text(f(locs(ii)), pks(ii),sprintf(' Order = %6.3f N',pks(ii))))
end
How can I add the variable o before order?
I would appreciate any input.
댓글 수: 1
Azzi Abdelmalek
2016년 8월 4일
You can make your question clear, explain your problem with an example and the expected result.
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!