Back to basics 23 - Triangular matrix - MATLAB Cody - MATLAB Central

Problem 413. Back to basics 23 - Triangular matrix

Difficulty:Rate

Covering some basic topics I haven't seen elsewhere on Cody.

Given an input matrix, return a matrix with all elements above and to the right of the main diagonal set to zero. Example:

input = [ 1 1 1 1; 1 1 1 1; 1 1 1 1; 1 1 1 1]
output = [1 0 0 0; 1 1 0 0; 1 1 1 0; 1 1 1 1]

Solution Stats

58.92% Correct | 41.08% Incorrect
Last Solution submitted on May 06, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Group

Matrix Manipulation I Image
Matrix Manipulation I
  • 16 Problems
  • 101 Finishers

Problem Recent Solvers1053

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page