Azzera filtri
Azzera filtri

problem with matrix dimension

2 visualizzazioni (ultimi 30 giorni)
RADWAN A F ZEYADI
RADWAN A F ZEYADI il 8 Feb 2022
Commentato: Jan il 8 Feb 2022
Hi
i have matrix (51*500) contain values for som properties but i want to put thi atrix along horiziontal axis for 80 position wich the final dimension becoms 51*80?

Risposte (1)

Jan
Jan il 8 Feb 2022
Modificato: Jan il 8 Feb 2022
How are input and output related? Maybe one of this methods do, what you need:
x = rand(51, 500);
y1 = x(:, 1:80); % First 80 columns
y2 = x(:, end - 79:end); % Last 80 columns
y3 = interp1(1:500, x.', linspace(1, 500, 80)).'; % Linear interpolation
  3 Commenti
RADWAN A F ZEYADI
RADWAN A F ZEYADI il 8 Feb 2022
doesnt work can i upload the code
Jan
Jan il 8 Feb 2022
Remember, that I still do not know, what you want to do. "Doesn't work" does not explain in any way, what is not working. So without knowing, what you want to achieve and what is failing, there is no chance to help you.

Accedi per commentare.

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by