Eli
Eli

Reputation: 38989

Is There a Placeholder Variable in Octave?

I'm trying to get the max indexes by row from a matrix. To do this, I'm doing:

[throwaway, indexes] = max(blah, [], 2);

The variable "throwaway," would store values I don't want anymore and would never use, and I don't want to waste memory on it. Is there some way to indicate I don't want anything put into that throwaway variable? Something like undef in Perl, perhaps?

Upvotes: 3

Views: 529

Answers (1)

thirdhaf
thirdhaf

Reputation: 138

Yes, you can throw away return arguments with ~ for examples if func returns two arguments only v will be available after the following [~, v] = func()

Upvotes: 4

Related Questions