You just use the * operator, as you might expect, e.g.
y = x * k;
where x is the input image, k is a scalar value, and y is the resulting scaled image.
Answer from Paul R on Stack OverflowTutorialsPoint
tutorialspoint.com โบ matlab โบ matlab_vector_scalar_multiplication.htm
MATLAB - Scalar Multiplication of Vectors
Scalar multiplication produces a new vector of same type with each element of the original vector multiplied by the number. Create a script file with the following code โ ยท v = [ 12 34 10 8]; m = 5 * v ยท When you run the file, it displays ...
MathWorks
mathworks.com โบ matlab โบ mathematics โบ elementary math โบ arithmetic operations
times - Multiplication - MATLAB
The sizes of A and B must be the same or be compatible. If the sizes of A and B are compatible, then the two arrays implicitly expand to match each other. For example, if one of A or B is a scalar, then the scalar is combined with each element of the other array.
MathWorks
mathworks.com โบ matlabcentral โบ answers โบ 1912765-multiply-individual-cells-of-a-matrix-by-a-scalar-using-a-for-loop
Multiply Individual Cells of a Matrix by a Scalar Using a For Loop - MATLAB Answers - MATLAB Central
February 15, 2023 - For example, to multiply each element of matrix p1 by a scalar value 100, you can write: ... This will create a new matrix with the same dimensions as A, where each element of p1 is multiplied by 100. Sign in to comment. ... https://www.mathworks.com/matlabcentral/answers/1912765-multiply-individual-cells-of-a-matrix-by-a-scalar-using-a-for-loop#answer_1171895
Top answer 1 of 3
4
v*u is algebraic matrix multiplication, for which the rule is that for an (M x N) * (P x Q) operation, that N must equal P and the output size is M x Q -- so (M x N) * (N x Q) giving M x Q. You have (1 x 5) * (1 x 5) which violates that rule. When you take u * v' then you have (1 x 5) * (5 x 1) giving 1 x 1.
v.*u would go element by element, result(K) = v(K) * u(K) which would be 1 x 5 result.
2 of 3
0
The simple answer to the question is:-
u= [ 1 2 -1 2 1] and v=[ -1 0 2 0 1] are both row vectors. You cannot matrix multiply them because the number of rows and columns are not compatible for matrix multiplication. To multiply u*v by matrix multiplication requires the number of rows of u to equal the number of columns of v, which it does not since u has one row and v has 5 columns. To correct that, you have to transpose v, then it has one column. v' is the transpose of v. This why u*v' works.
MathWorks
mathworks.com โบ symbolic math toolbox โบ symbolic computations in matlab โบ operators and elementary operations
times - Symbolic array multiplication - MATLAB
Multiply the matrix by the symbolic expression sin(b). Multiplying a matrix by a scalar means multiplying each element of the matrix by that scalar.
MathWorks
mathworks.com โบ matlabcentral โบ answers โบ 284965-how-can-i-multiply-a-vector-by-scalar
how can I multiply a vector by scalar? - MATLAB Answers - MATLAB Central
May 19, 2016 - Hi, I have a very simple case. I do not know why there is an error which says, (Undefined operator '*' for input arguments of type 'cell').C1 is a [1*44998] and k=[1*300] vectors. my purpose is to...
MathWorks
mathworks.com โบ matlabcentral โบ answers โบ 598096-multiplying-scalar-by-matrix
multiplying scalar by matrix - MATLAB Answers - MATLAB Central
September 22, 2020 - Instead, you are dividing by lambda, and then multiplying by k and T. ... You're welcome. FYI, this was fairly easy to debug by inspecting the variable values when you plotted them.
University of Pennsylvania Department of Linguistics
ling.upenn.edu โบ courses โบ ling545 โบ BasicLinearAlgebraInMatlab.html
COGS501 -- Homework 1 part 1 -- Matlab tour
You can enter a vector in Matlab by surrounding a sequence of numbers with open and close square brackets: ... The individual numbers that make up a vector are called elements or components of the vector. Operations on vectors include scalar multiplication (also of course scalar addition, subtraction, division)
MathWorks
mathworks.com โบ matlabcentral โบ answers โบ 300258-multiplying-column-with-scalar
Multiplying column with scalar - MATLAB Answers - MATLAB Central
August 20, 2016 - And I need to multiply that with some scalar let's say 4. So I type in make matrix x = [1 2 3 4 5 6] and y= [7 ;7; 7; 8; 9; 10] And type this x*y*4 and get a 6x6 matrix. I want to get a 1x6 or 6x1 matrix with results. What would be optimal solution? Sign in to comment. Sign in to answer this question. ... https://www.mathworks.com/matlabcentral/answers/300258-multiplying-column-with-scalar#comment_386293
MathWorks
mathworks.com โบ matlabcentral โบ answers โบ 1917385-multiplying-row-vector-by-a-scalar
multiplying row vector by a scalar - MATLAB Answers - MATLAB Central
February 23, 2023 - My question still remains: Need help finding a way to multiply the 3rd row of my matrix by a scalar value, for example 100. ... https://www.mathworks.com/matlabcentral/answers/1917385-multiplying-row-vector-by-a-scalar#comment_2629055
TutorialsPoint
tutorialspoint.com โบ matlab โบ matlab_matrix_scalar_operation.htm
MATLAB - Scalar Operations of Matrices
Scalar operations produce a new matrix with same number of rows and columns with each element of the original matrix added to, subtracted from, multiplied by or divided by the number.
YouTube
youtube.com โบ watch
Matlab Tutorial - 37 - Adding and Subtracting Matrices and Multiplying by a Scalar - YouTube
Get more lessons like this at http://www.MathTutorDVD.comLearn how to add matrices in matlab. We will also learn how to subtract matrices and multiply a mat...
Published: March 23, 2018
MathWorks
mathworks.com โบ fixed-point designer โบ data types exploration โบ fixed-point specification โบ fixed-point specification in matlab โบ fixed-point math functions
times - Element-by-element multiplication of fi objects - MATLAB
Use the times function to perform element-by-element multiplication of a fi object and a scalar.
YouTube
youtube.com โบ watch
Matlab Tutorial - 24 - Adding and Subtracting Vectors and Multiplying Vectors by a Scalar - YouTube
Get more lessons like this at http://www.MathTutorDVD.comLearn how to add and subtract vectors in matlab. We will also learn how to multiply a vector by a s...
Published: March 23, 2018
MathWorks
mathworks.com โบ matlabcentral โบ answers โบ 1989028-multiplying-with-a-with-a-scaler-in-a-vector-element-at-regular-interval
multiplying with a with a scaler in a vector element at regular interval - MATLAB Answers - MATLAB Central
June 28, 2023 - https://www.mathworks.com/matl... by a scalar at regular intervals (3, 6, 9, 12, 15), you can use indexing to access those elements and perform the multiplication....
MathWorks
in.mathworks.com โบ matlabcentral โบ answers โบ 492476-scalar-and-matrix-multiplications
SCALAR AND MATRIX MULTIPLICATIONS - MATLAB Answers - MATLAB Central
November 21, 2019 - AE=8000000; %N %Truss Lengths (m) La=3; %Truss A la=(3-0)/La; ma=(4-4)/La; matKeA=[ la^2, la*ma, -(la^2), -la*ma; la*ma, ma^2, -la*ma, -(ma)^2; -(la)^2, -la*ma, la^2, la*ma; -...