Community Profile

# Taif Ahmed BIpul

##### Last seen: 2 months ago
8 total contributions since 2020

View details...

Contributions in
View by

[Assignment]Write a function called saddle that finds saddle points in the input matrix M.
function indices=saddle2(M) k=0; indices1=zeros(k); indices2=zeros(k); rowIndices=zeros(k); colIndices=zeros(k); for i=1:s...

2 months ago | 0

I get an error, what's wrong? on Sparse matrix logic and answer
function matrix=sparse2matrix(cellvec) m=ones(cellvec{1}(1),cellvec{1}(2)); m=m.*cellvec{2}; for i=3:length(cellvec) m(cellv...

3 months ago | 0

Write a function called max_sum that takes v, a row vector of numbers, and n, a positive integer as inputs. The function needs to find the n consecutive elements of v whose sum is the largest possible.
function[summa,index]=max_sum(v,n) if size(v,2)<n summa=0; index=-1; return end p=size(v,2)-(n-1); k=1; A=...

3 months ago | 0

next prime number using While loops
function k=next_prime(n) if isscalar(n) && n>0 && n==fix(n) n=n+1; while ~isprime(n) n=n+1; end k=...

3 months ago | 0