1

For example, I have a function

[power, capacity] = function_name(users, distance, radius)

and the function call is

[~, capacity] = function_name(users, distance, 5);
Kotsos
  • 229
  • 4
  • 15

1 Answers1

1

~ just means that you don't want to store the result in any variable.

here is a detailed explanation: http://www.mathworks.com/matlabcentral/answers/72537-what-does-a-tilde-inside-square-brackets-mean

And the most relevant section: "when you use [~,palette], that means that you just want the second output of your function, and do not care the first one."

lukevp
  • 705
  • 4
  • 16
  • Thank you! Google search does not accept the "~" sign, it simply ignores it - do you believe that? And I don't know the English word for that symbol, so I could not find a way to "google" it. Thanks! – Kotsos Jan 31 '15 at 01:14
  • Sure thing, glad I could help! Please accept the answer as well :) For your info, it is called a "tilde" in english. – lukevp Jan 31 '15 at 01:15
  • Yes, I will, I just I have to wait for 7 minutes to do so. Thanks also for the vocabulary info! – Kotsos Jan 31 '15 at 01:16
  • Oh, I didn't know about that restriction! Good to know. – lukevp Jan 31 '15 at 01:17