This question already has answers here:
How to execute multiple statements in a MATLAB anonymous function?
(5 answers)
Closed 7 years ago.
Is it possible to create multiline anonymous function in Matlab?
There are no appropriate examples in documentation, but also no direct denials. In web discussions I found some derisions of askers as if it silly wish. Nowadays, when most languages introducing lambda expressions with multiline capability this looks strange.
No, unfortunately this is not possible.
Related
This question already has an answer here:
Check if IEnumerable is empty in PowerShell
(1 answer)
Closed 1 year ago.
While PowerShell has nice syntaxes like JavaScript's filter, map, reduce is there a syntax which is equivalent to some?
You could try using LINQ in PowerShell and then you can use LINQ Any which "Determines whether any element of a sequence exists or satisfies a condition."
This question already has answers here:
Common Lisp equivalent to C enums
(3 answers)
Closed 2 years ago.
I've been learning Common Lisp this week, toying a bit with it. As an exercise, I would like to translate some Haskell code I had written to simulate balanced ternary. The core of it is the type:
Data Trit = Pos | Neutr | Neg
How do I declare a type of that kind in Lisp? The idea is that this type should only have three possible values.
In Common Lisp programs, you will simply use symbols 'Pos, 'Neutr and 'Neg.
If you really need a specific type, you could refer to:
Common Lisp equivalent to C enums but I would suggest to keep it simple and stay with 'Pos, 'Neutr and 'Neg.
This question already has answers here:
How can I generate a list of function dependencies in MATLAB?
(2 answers)
Closed 8 years ago.
Assume I have written two MATLAB functions foo.m and bar.m
I want to know if foo.m calls bar.m
I tried using depfun and listing dependencies and checking if bar is a member. It didn't work.
It seems depfun only returns builtin functions.
Is there a way around this when bar.m is not a built in function?
There are various techniques listed in the documentation to identify file dependencies, one of them should do the trick.
Note: the techniques listed in the documentation page I mentioned are for the latest release R2014b, they may not all be available in earlier releases.
This question already has answers here:
Go back to last state
(2 answers)
Closed 8 years ago.
I would like to save the state of a Lisp compiler so that I need not load my file in several minutes, but instead I would load that image in seconds.
Which Common Lisp compiler would do this favor for me?
I came to this idea as Standard ML of New Jersey does this: Exporting Heaps.
I could not find similar in the sbcl manual or the
ecl manual.
With SBCL, use save-lisp-and-die. To restart the image, use the --core arguments.
Read carefully the caveats in the documentation.
With CLISP, use EXT:SAVEINITMEM
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Suppressing a function’s command window output
Suppress Output
Is there a way to "silence" the output of a Matlab function? In other words, if a function generates some displayed text in the command window, is there a way to run it in a quiet mode, where the output is suppressed?
In my case, I am using a third-party function iteratively that displays a lot of text, and I want to find a way to suppress that text without modifying the function itself. I'm thinking there must be some kind of wrapper function like quiet(thirdpartyFunction) that gives this kind of behavior. Or is this wishful thinking?
You can probably use evalc and discard the return value.