Tridiagonal matrix - MATLAB Cody - MATLAB Central

Problem 43291. Tridiagonal matrix

Difficulty:Rate

Given vectors u and v, make a tri-diagonal symmetric matrix such that u is in the main diagonal and v is below and above diagonal

u = [1 4 5 6]
v = [3 8 2]

the result would be:

[ 1     3     0     0
  3     4     8     0
  0     8     5     2
  0     0     2     6 ]

Solution Stats

85.71% Correct | 14.29% Incorrect
Last Solution submitted on Jan 22, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers42

Suggested Problems

More from this Author2

Problem Tags

Community Treasure Hunt

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

Start Hunting!