Community Profile

photo

Taif Ahmed BIpul


Last seen: 2 months ago
8 total contributions since 2020

Taif Ahmed BIpul's Badges

  • First Answer

View details...

Contributions in
View by

Answered
[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

Answered
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

Answered
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

Answered
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

Answered
Write a function called halfsum that takes as input an at most two-dimensional array A and computes the sum of the elements of A that are in the lower right triangular part of A
function summa=halfsum(A) [m,n]=size(A); summ=0; for i=1:m for ii=i:n summ=summ+A(i,ii); end end summa=s...

3 months ago | 0

Answered
how to replace elements in top third, middle third, and bottom third of matix
function T=trio(n,m) T=[ones(n,m);ones(n,m)*2;ones(n,m)*3]; end

3 months ago | 0