d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Matlab Programing Help Asap
Add Reply New Topic New Poll
Member
Posts: 35,671
Joined: Aug 11 2008
Gold: 2,130.00
Mar 4 2018 05:22pm
lets say I have a matrix

A = [ 9 2 4 1
7 8 9 10
11 12 13 14]


I want the new matrix to read

A = [ 9
2
3
4
1
6
7
8
9
10
11
12
13
14]

how do i do this? I want it to be one column and it reads the numbers from left to right.
Member
Posts: 3,417
Joined: May 15 2009
Gold: 1,201.69
Mar 4 2018 07:17pm
A = reshape(A',[],1)

This post was edited by marioo1182 on Mar 4 2018 07:19pm
Member
Posts: 35,671
Joined: Aug 11 2008
Gold: 2,130.00
Mar 4 2018 07:21pm
Quote (marioo1182 @ Mar 4 2018 08:17pm)
A = reshape(A',[],1)


tyty
Member
Posts: 35,671
Joined: Aug 11 2008
Gold: 2,130.00
Mar 4 2018 09:14pm
another question is... how do i pull out the aboluste maximum value of a function?

like say I have a u(t), U(t) is supppose to go up down up down like crazy, like a wave.. and i want to pull out the extreme maximum (highest/lowest point)
Member
Posts: 3,417
Joined: May 15 2009
Gold: 1,201.69
Mar 4 2018 10:19pm
Quote (FamilyGuyViewer @ 4 Mar 2018 20:14)
another question is... how do i pull out the aboluste maximum value of a function?

like say I have a u(t), U(t) is supppose to go up down up down like crazy, like a wave.. and i want to pull out the extreme maximum (highest/lowest point)


Say you have the equation y = sin(x)

You would want to plug in a range of values. So you could let:

x = 0 : 0.1 : 2*pi;
then,

y = sin(x);

Then just use,

max(y)
min(y)

and Matlab will give you the min and max for the function (only within the range of values that you input however)
Go Back To Homework Help Topic List
Add Reply New Topic New Poll