Pull Value from MATLab Matrix: Solve the Problem

  • Context: MATLAB 
  • Thread starter Thread starter Ethers0n
  • Start date Start date
  • Tags Tags
    Matlab Matrix
Click For Summary
SUMMARY

The discussion focuses on extracting values from a matrix in MATLAB. Users can access specific elements by referencing their row and column positions, such as using the syntax M(row, column). For example, M(1, 2) retrieves the element located in the first row and second column of the matrix. This method is essential for manipulating and retrieving data from matrices effectively in MATLAB.

PREREQUISITES
  • Basic understanding of MATLAB syntax and matrix operations
  • Familiarity with matrix indexing in MATLAB
  • Knowledge of variable assignment in MATLAB
  • Experience with mathematical operations in MATLAB
NEXT STEPS
  • Research MATLAB matrix manipulation techniques
  • Learn about MATLAB indexing and submatrix extraction
  • Explore MATLAB's built-in functions for matrix operations
  • Investigate advanced data handling in MATLAB, such as cell arrays
USEFUL FOR

This discussion is beneficial for MATLAB users, data analysts, and engineers who need to manipulate and extract data from matrices in their projects.

Ethers0n
Messages
27
Reaction score
0
Does anyone know how to pull the value of an element which has been calculated and placed in a matrix out of the matrix?

ie.

M = [a1, a2;
b1, b2];

c = a1*3;

?

I can't seem to find any information online...

Thanks.
 
Physics news on Phys.org
You reference elements like this:

Given any matrix
Code:
M=[a1,a2,a3,...,an;
         .
         .
         .
   m1,m2,m3,...,mn]
an element is accessed by referenceing its row and column position. So,
M(c,10) would return the element loacted in the third row, 10th column.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K