macro in matlab for incomplete syntax
12 views (last 30 days)
Show older comments
I wonder if there is a way to create a short cut for incomplete program.( Creating functions can only serve for complete programs, right? )
Like in Stata:
local aa ########
these mean asign the latter apart (########) to former sign (aa) , whatever ######## is, even an incomplete syntax. It could be really really useful.
For a stupid example:
local a valuable1=
local b ^2/4
local c 2
local d =1/4
`a'`c'`b'
it means valuable1=2^2/4=1
if `a'`d' {
valuable2`c'`d'9`b'`b'
}
it means if valuable1=1/4 execute that asign valuable22=1/49^2/4^2/4. In this example, you can see that i create valuable22 by valuable2`c', and asign = to the formula creating 1/49 at the same time by `d'9
Both of 2 example above use ` ' to cite what we need. And those in ` ' can be a incomplete syntax.
Because of being incomplete, we can use the same sets of macro to create many thing easier (not in here, after all just examples)
And it can asign entirely a complete function.It really only depend on what you write at the end of the command local. When syntax become very long, it is very convinient ,such as:
local q ###############################################################################################
local w &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
local e @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
`q' `w' `e' `w' `e' `q' `e' `q' `w'
even
local r `q' `w'
local y `r' `r`q`w`r`r`r`r'''''''
Using macro for asign a new macro, Imagine that !!!
So, how can i perform the same "function" in matlab?
5 Comments
Answers (0)
See Also
Categories
Find more on Historical Contests in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!