How Can I Compute the Saturation of Each Element in a Matrix Using Mathematica?

In summary, to "take the minimum valued matrix" and "then compute the saturation for it," you need to first determine which of the three matrices has the lowest overall value. This can be done by using the Min function, which finds the smallest element from a list of numbers. Once you have identified the minimum valued matrix, you can then apply the saturation function (S:=1-3(Min r,g,b)) to each element in that matrix, resulting in a new n x n matrix with the saturation values for each element. This will give you the desired result of the original n x n matrix after the function has been applied.
  • #1
Agent M27
171
0
I have three n x n matrices for which I am try to compute the saturation of each element in the matrix. The function to find this is S:=1-3(Min r,g,b) where r,g,b are the color channel matrices. For my output I am trying to get it to return an n x n matrix with each element having the function S applied to it. When I run that code it returns a single value, not a matrix, that is between 0 & 1, which is not correct. If I change the function S for example, to be S:=1-3b, it returns the desired result of the original n x n matrix after the function has been applied. So what I think mathematica is doing is, it is comparing the elements of the three matrices and using the lowest value of all elements to compute, but what I need it to do is take the minimum valued matrix and then compute the saturation for it. Any assistance would be appreciated. Thanks.

Joe
 
Physics news on Phys.org
  • #2
The documentation for Min says if it is given lists then it yields the smallest element of any of the lists and a couple seconds of experimenting seems to show this happens no matter how the lists are nested. So your guess about what it is doing appears to be correct.

Please describe simply and clearly how to "take the minimum valued matrix" and "then compute the saturation for it."
 

1. What is Mathematica?

Mathematica is a powerful software program used for mathematical and scientific calculations, data analysis, and visualization. It is commonly used by scientists, engineers, and mathematicians to solve complex problems and create visual representations of data.

2. How can Mathematica assist with matrix operations?

Mathematica has built-in functions and algorithms specifically designed for matrix operations. These include functions for matrix multiplication, inverse, determinant, and many more. It also has a user-friendly interface for creating and manipulating matrices.

3. Can Mathematica handle large matrices?

Yes, Mathematica is capable of handling large matrices with thousands or even millions of elements. It uses efficient algorithms and can utilize multiple CPU cores to speed up calculations.

4. Is Mathematica only useful for numerical matrices?

No, Mathematica can handle both numerical and symbolic matrices. This means that it can perform calculations and manipulations on matrices with variables or symbolic expressions as elements.

5. Can Mathematica plot matrices or matrix equations?

Yes, Mathematica has powerful plotting capabilities that can be applied to matrices and matrix equations. It can create 2D and 3D visualizations of matrices, as well as plot the solution to matrix equations as a function of different parameters.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
262
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
936
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Replies
4
Views
1K
  • Quantum Physics
Replies
13
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top