Write function that returns true if (inputmatrix > 0)
Show older comments
I suppost Write a function with given matrix A returns matrix P where element P(i,j) = true if the corresponding elements in (A(i,i)>0) and false otherwise. I don't really udnersatnd the queation, why does it say P(i,j) and then A(i,i)?
it is hinted that we can use nested for-loop but as i stated above i don't really get the question so it makes it hard to execute the code. Any kind soul that can help me get a start?
function P = positive(A)
for
for
end
end
end
Accepted Answer
More Answers (1)
A = rand(5) ;
P = A > 0.5
Categories
Find more on Loops and Conditional Statements 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!