Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> f = @(x) 5.*x-2
- f =
- @(x)5.*x-2
- >> a = randn(6)
- a =
- 1.2607 0.0230 0.6252 0.5152 1.6821 -0.2741
- 0.6601 0.0513 0.1832 0.2614 -0.8757 1.5301
- -0.0679 0.8261 -1.0298 -0.9415 -0.4838 -0.2490
- -0.1952 1.5270 0.9492 -0.1623 -0.7120 -1.0642
- -0.2176 0.4669 0.3071 -0.1461 -1.1742 1.6035
- -0.3031 -0.2097 0.1352 -0.5320 -0.1922 1.2347
- >> a = a * (a>10)
- ans =
- 12.6066 5.1525 0 0 12.6066 14.3108
- 6.6014 2.6141 0 0 6.6014 7.0563
- -0.6787 -9.4149 0 0 -0.6787 0.9322
- -1.9522 -1.6234 0 0 -1.9522 -2.4924
- -2.1761 -1.4605 0 0 -2.1761 8.9616
- -3.0311 -5.3201 0 0 -3.0311 8.3273
- >> f(ans)
- ans =
- 61.0329 -2.0000 -2.0000 -2.0000 82.1052 -2.0000
- -2.0000 -2.0000 -2.0000 -2.0000 -2.0000 74.5036
- -2.0000 -2.0000 -2.0000 -2.0000 -2.0000 -2.0000
- -2.0000 74.3488 -2.0000 -2.0000 -2.0000 -2.0000
- -2.0000 -2.0000 -2.0000 -2.0000 -2.0000 78.1729
- -2.0000 -2.0000 -2.0000 -2.0000 -2.0000 59.7340
- >> ans .* (ans > 0)
- ans =
- 61.0329 0 0 0 82.1052 0
- 0 0 0 0 0 74.5036
- 0 0 0 0 0 0
- 0 74.3488 0 0 0 0
- 0 0 0 0 0 78.1729
- 0 0 0 0 0 59.7340
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement