Can imtranslate and squeeze be combined to one code line?
1 回表示 (過去 30 日間)
古いコメントを表示
Can you combine squeeze and imtranslate to one line? If so, how?
4 件のコメント
Jan
2018 年 7 月 10 日
@Stelios: You are not a newcomer in this forum. Please remember to post the complete error message, not just a part of it.
I'm convinced, the message reveals the detail, that you provide 2 input arguments to the squeeze command, but this accepts 1 only. You can find the cause of such problems using the debugger. Type this in the command window:
dbstop if error
Now run the code again until it stops at the error. Check the sizes of the variables and run the code in pieces:
size(translation_vector)
class(translation_vector)
size(im)
class(im)
% This is done as standard, but does not reveal the problem yet...
% But this does:
c = squeeze(im, translation_vector)
Using the debugger is more efficient than asking the forum.
回答 (1 件)
Guillaume
2018 年 7 月 10 日
編集済み: Guillaume
2018 年 7 月 10 日
As long as you only need the first output of each function, you can chain as many functions as you want regardless of what they are.
Now the question is a bit bizarre, so indeed an explanation of why you're asking that would be welcome.
edit, following your comment
Come on, you're studying for a PhD, engage your brain!. Of course you get an error, you're trying to pass both input arguments to squeeze. Assuming it's the image you want to squeeze (why?) then:
imtranslate(squeeze(im), translation_vector)
5 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!