已回答
Im lost sum1 help me with the code, im new to this Matlab programming
Dear Merapelo, you can do it like this: width = input('Enter width of rectangle (value should be positive and greater than ...

11 years 前 | 0

已回答
how to perform matrix manipulation for a game of battle ship?
roshan try this: Board = zeros(10); ALPHArange = 'A':'J'; Drow = ALPHArange(randi(numel(ALPHArange))); Dcol = randi(9,1,...

11 years 前 | 0

| 已接受

已回答
i need some help on matrix operations!
do you need something like this: a=[0 1 0 1 1 0 1]; v=[2 3 4 2 6 1 8]; for i = 1:numel(a) sum = 0; for j ...

11 years 前 | 0

| 已接受

已回答
help with teachers code?
x{ii}(:,1:(ii-1)) =minInt(:,1:(ii-1)) this line of code is accessing all rows values for columns 1 to ii-1 and then saving...

11 years 前 | 0

已回答
Plot in real time
Dear Jerry try this: A = 3.3; W = 6.28; for t = 0:0.01:2 y = A * sin(W * t); plot(t, y, 'g*'), hold on drawnow; ...

11 years 前 | 0

已回答
How to assign discrete values in a single matrix by considering four conditions
you can do it as follows: A = rand(10); A(A > 0.75) = 3; A(A > 0.5 & A < 0.75) = 2; A(A > 0.25 & A < 0.5) = 1; A(A < 0....

11 years 前 | 0

| 已接受

已回答
Creating matrices automatically WITH FOR LOOP
Dear Selman, you can use: A{i} = [i; i + 1] Here A will be a cell array whose each element will be your desired matrix

11 years 前 | 2

| 已接受

已回答
is there a function that calculates the no. of rows or cols
Dear mary, use [row, col] = size(a)

11 years 前 | 0

| 已接受

已回答
How to put this information is a table?
Dear Todd, just do as follows: count = 1; %Number 1 and 2 x0=[42;0;95]; extinct=0; W=zeros(1,200); ...

11 years 前 | 0

已回答
How can I use the output of "sprintf" to read the content of a matrix
Dear Saad, if i understood correctly you need to do something like this: c={'USA','EUR','JAP','UK'}; results_USA = rand(...

11 years 前 | 0

| 已接受

已回答
matrix multiplication issue.. i need the result to be in binary numbers
Dear Mary, you can do it as follow: m = rand(1,4) > 0.5; G = [1 1 1 1 1 0 0 0 1 0 0 0; 0 0 1 1 0 0 0 1 0 1 0 0; 1 1 1 0 ...

11 years 前 | 0

| 已接受

已回答
cellfunc -multiplication of two cells
Dear Mihnathul, I completely agree with Walter. Your question is not completely clear, however if you really insist to use cellf...

11 years 前 | 0

已回答
How can I find values within a range of one column in a two column matrix, and get the value plus the corresponding value in the other column?
Dear MacKanzie, You can do something like this: A = [ 1 6; 2 6; 3 7; 4 7; 5 8; 6 4; 7 2]; a = find(ismember(A(:, 2),...

11 years 前 | 0

| 已接受

已回答
Why does start up require internet access?
Dear Andy, maybe following links are helpful for you: <http://www.mathworks.de/de/help/matlab/matlab_env/start-matlab-on-wind...

11 years 前 | 0

已回答
Symbolic Math Error using diff
Dear Carlas, you can try something like this: x = sym('x%d',[2 1]); A = sym('A%d%d',[2 2]); x1 = diff(x' * A * x, x(...

11 years 前 | 0

| 已接受

已回答
Using a function that will receive a variable number of values and return using the R equation? - Homework
Dear Nora, you can do something like this: if nargin == 0 error('No input arguments') else sum = 0; ...

11 years 前 | 0

| 已接受

已回答
How to put a red border area in the graph ?
you can do it as follows: figure(1); fill([x; flipud(x)],[y1; flipud(y2)],'g'), hold on, plot(x, y1, flipud(x), flipu...

11 years 前 | 1

| 已接受

已回答
how to make a curve smooth ??
Dear Mary, you can use smooth function for this purpose. See the following link for more information: <http://www.mathworks.de/d...

11 years 前 | 0

已回答
Correctly sum image values
Dear Andy, try this: avRed = sum(sum(im(xx,yy,1)))/el; avGre = sum(sum(im(xx,yy,2)))/el; avBlu = sum(sum(im(xx,yy,3))...

11 years 前 | 1

| 已接受

已回答
how to scan a hex file and then search for the required byte and display
Dear Prabhav, you can do it as follows: % Read file in the form of string ID = fopen('filename.txt'); A = textscan(ID...

11 years 前 | 0

| 已接受

已回答
variables problem , infinite loop
Dear Yasin, you can use round or floor or ceil or format for this purpose. Also don't use con...

11 years 前 | 0

已回答
Complex number output vector instead of real output
Dear Nikhil, you can use following line of code to see imaginary part of Jones vector ImaginaryPartofJr = imag(Jr) and ...

11 years 前 | 0

| 已接受

已回答
How can I create a joint (2D) histogram of two equally-sized datasets?
Dear Patrick, maybe the following link is helpful for you: <http://blogs.mathworks.com/videos/2010/01/22/advanced-making-a-2d...

11 years 前 | 0

| 已接受

已回答
Timer in matlab to repeat segments of code every few minutes?
Dear P, you can use pause command or cputime or etime according to your need: See following links for more information: <h...

11 years 前 | 0

已回答
How can I add many matrices together, end to end?
Dear Patrick, you can use horzcat See <http://www.mathworks.de/de/help/matlab/ref/horzcat.html> or vertca...

11 years 前 | 0

| 已接受

已回答
How can I load a set of files ordered by date and time?
Dear Patrick, you can use 'dir' command to get information of all the files in a specific folder as: files = dir('C:\Users\...

11 years 前 | 0

| 已接受

已回答
Why is that when i change my phase angle, the amplitude changes in sin and cos functions in Matlab?
Dear Nina, values for sin and cos varies between -1 and 1 so when you add two sinusoidal functions(as you are doing) then at som...

11 years 前 | 0

| 已接受

已回答
Several rows of values in x-axis
Dear Icequeen, The following link will be quite helpful for you: <http://www.mathworks.com/support/solutions/en/data/1-D47WBX...

11 years 前 | 1

| 已接受

已回答
Switch case with strings?
Dear Shannon, maybe you can do as follows: count = 0; while count < 3 ShapeName = input('Enter shape name: ', 's'...

11 years 前 | 4

已回答
Making a generalized script, very new MATLAB user!
Dear Andrew, one way to generalize the code is as follows: syms a n = 20; % Number of variables for function f x = sy...

11 years 前 | 0

加载更多