I want to use dot operator in matlab to perform element by element multiplication of a matrix. How can I do it? for example: I have two 2x3 matrices [1 2 3; 1 1 2], [1 -1 2; 4 1 1]. My output after multiply 2 matrices should look like: 1 -2 6 4 1 2
Example A = 1 2 B = 2 3 3 4 4 5 ans=A*B = 10 13 22 29
I have a few matrices and arrays such as Arrays : A = [1 3 5 ], B = [2 5 6], C = [ 1 5] Matrices D = [ 1 3; 2 5], E = [ 1 3; 2 5; 1 4], H = [ 1 3 4; 2 5 5; 1 4 6], I = [ 5 3 4; 2 1 5], Please let me know which matrices or array can I multiply, invert, add?
How to multiply 2 matrices?
A = 5 2 B = 6 3 3 4 8 10 ans=A+B = 11 5 11 14
I am new to Matlab and I want to define variables, array, strings in Matlab so that I can play with them, Please let me know how can I do it? Thanks
I have a set of following linear equations: 10x + 2y - z = 27 -3x - 6y + 2z = -61.5 x + y +5z = 21.5 I want to use the lu function to perform LU factorization on A such that LU=A. how can I use L and U matrices to find the inverse of A.
I am new to Matlab,but I already know C. I dont know how can I use my knowledge of C in Matlab? I mean How is Matlab different from C? Do i need to define variables type and so on?
How can you use structures to add, subtract, multiply and divide complex numbers?
create a sample program to show the use of 2-D Arrays in java.
Please see attached file. Develop MATLAB Script file as discussed in class to reproduce the figures in the attached file. You can find the original image at the URL http://www.stlzoo.org/files/6613/0798/4136/flamingo.jpgrnYou will need to make yourself familiar with the MATLAB image processing toolbox functions such as imread(), imshow() , (impixel, improfile), rgb2hsv(), hsv2rgb ( )using MATLAB help. Also hist( ) function in MATLAB will be useful to produce the hue histograms of the original and altered images. As discussed in class you can use Microsoft Paint to look at RGB and HSV numbers in images. You can choose any two alternative colors for altered imagery (Microsoft Paint can help you select the color using the Hue numbers). Please note that rgb2hsv () will scale the pixel to numbers between 0 and 1. To be able to correlate with the Hue colors that you see in MS Paint you will need to multiply the pixel numbers corresponding “Hue” layer by 240 ( and other layers as well if you so choose) since MS Paint puts Hue, Sat, Lum into a scale of 0 -240.rnAlso use the hist( ) function on hue numbers on the 0-240 scale to produce the hue histograms so that the color distribution of hue layer becomes consistent with colors and corresponding numbers in MS paint. Also remember to reshape the Hue matrix into a column vector using reshape( ) function before using hist( ) to create the hue histograms.rnAfter you find and alter the pixels in the Hue layer to appropriate color, you will need to scale back the numbers by dividing by 240 and use the double( ) function or other similar function in MATLAB to get back to appropriate hsv scale (0-1) before you convert back to RGB format using hsv2rgb( ) function and display the altered image using imshow ( ).rnUse subplot(p,q,r) and title commands to reproduce the results as shown in the attached.rnYou should also run the program on other images that you acquire with your own camera and provide similar results as shown. ( Please be aware that different cameras have different pixel density and hence the image sizes may be different.)rnExtra Credit : Using the original image of the flamingo develop a code so that some of the birds on the left hand side becomes yellow, some in the middle remains the original color and some in the right becomes cyan. Make sure the reflections are changed to appropriate colors also. ( Any other alternative color choices is also fine)
I have two martices A=[1 2 3;4 5 6;7 8 9] and B = [1 1 1; 1 1 1;1 1 1]. I want to concatenate them horizontally and vertically. the horizontal output should be like this: 1 2 3 1 1 1 4 5 6 1 1 1 7 8 9 1 1 1 Vertical output should look like this: 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1
I have to code jacobi in matlab to solve the following equation rn9a - 2b + 3c +24d = 54.5rn2a + 8b -2c + 3d = -14rn-3a + 2b +11c - 4d = 12.5rn-2a + 3b +2c +10 d = -21rnwith a 0.001 tolerance and an estimated max error which is e = abs(xns-xn)/(xn)rni've attached what i have so far any help please.
How to create a plotting matlab script, which does the following screen Fulscreen Increase font size Convert into pdf and save it to a file Plots on both sides of vertical axis.
I have a function y that I want to calculate using matlab y = e^(x+1) if x<-1 y = 2+cos(x) if -1<=x<5 y = 10(x-5) +1 if x>=5 I want to plot the value of y as a function of x
I have an ordinary differential equation dy/dx = -2x-y, with initial condition on y (x = 0) = -2, when x = 0 I want to numerically solver this ODE using 4th order Runke-Kutta Method in Matlab with a step size of 0.1.
How can I solve a linear programming problem (LP) in Matlab? Linear programming (LP) has linear objective function and linear constraints. eg. minimize: x+y subject to: x>1 y-x>5 y+x>3 Thanks.
How can I connect to a database in Matlab. I have a local database \'postgres\', username \'postgres\'. password \'123456\' port \'5432\' How would I know if I am being connected to the database? Thanks