Réponse apportée
Conway's Game of Life implementation
Limbert - I think that part of the problem might be with how your if and elseif statements are not being properly "ended". For e...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
how to full fill the diagonal of a matrix by a vector
Ahmed - try using a = [1 2 3 0 0]'; A = cell2mat(arrayfun(@(x)circshift(a,x-1),1:length(a), 'UniformOutput', false)); We use ...

environ 7 ans il y a | 1

Réponse apportée
How can I index where I found the contents of strfind?
Nicholas - perhaps something liek the following could be used if the MyStructure is similar to yours. MyStructure = []; for k ...

environ 7 ans il y a | 0

Réponse apportée
Plotting Space-Time Function in MATLAB?
Andong - I'm not sure if the below is exactly what you are looking for...when I tried it, it wasn't entirely obvious the changes...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
im stuck on making a layered matrix
Tristan - why not use a for loop surround = 1; for k = 2:5 surround = surroundWith(surround, k); end

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Trying to integrate sinx using the integrate function but when I plot the integral, instead of plotting from -1 to 1 it plots from 0 to 2. Does anyone know why this happens?
Guillermo - I'm guessing it is the y-axis limits that you want to be between -1 and 1? Why is the minimum value, a, fixed but th...

environ 7 ans il y a | 1

Réponse apportée
Help using While loop
Charles - I think that you could use a while or for loop on this code W = Na*MM(1,1,1); Q = Ca*MM(2,1,1); E = Si*MM(3,1,1); ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
plot columns of matrix
Filip - from plot, plot(Y) creates a 2-D line plot of the data in Y versus the index of each value. ... If Y is a matrix, th...

environ 7 ans il y a | 0

Réponse apportée
How do I make a user defined function in MATLAB to determine the volume of a revolving solid using the disk method?
By user-defined function, I suspect that they are just asking you to create a function with a specific signature (input and outp...

environ 7 ans il y a | 0

Réponse apportée
Trapezoidal rule for loop
Nima - perhaps try for n = [20,50,100,150,400] f = @(x)6*(cos(x/2)) .* (sin(x/2)).^2; % Defining given function a =...

environ 7 ans il y a | 2

Réponse apportée
Error using * Inner matrix dimensions must agree urgent help please.
Or - the error is due to the following multiplciation air_vec*normal_vec where both arrays/vectors are 3x1 and so the error me...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Error : Function definition is misplaced or improperly nested.
suoh - I think that one problem might be with your "else if". In MATLAB, there isn't a space and so this is just "elseif". The w...

environ 7 ans il y a | 0

Réponse apportée
how to store and display values coming from the for loop to an array variable.
Aishwarya - if each iteration of your loop creates a variable (of some kind) that you want to store or save for further processi...

environ 7 ans il y a | 0

Réponse apportée
Graph tiltle with multiple variables over 2 lines
Franc - try using sprintf to create one or more lines that you can use in your title. For example, myTitle = sprintf('first row...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How do i sum the total elements in a vector, not whats in each element
caitlin - if your movements are in a matrix, say nx2, where each row is a coordinate for the movement, then the number of moveme...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How to add cell array elements iteratively?
Hassan - first, please rename the sum variable since there is a built-in MATLAB function of the same name. If you want to add al...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Index in position 2 exceeds array bounds (must not exceed 25).
benjamin - isn't H of length Lx (or Ly since identical) and is an array? Treating it like a matrix as H(a,b) would then lead to ...

environ 7 ans il y a | 0

Réponse apportée
How do I prompt a user to input a number of values for their future inputts?
Mallard - use a for loop. For example, numYears= input('please enter number of years: '); cashFlows = zeros(numYears, 1); i...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Append matrix with subsequent images
Kevin - you may want to consider not using global variables. Instead use the handles structure to save the data that you want ot...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
i get error using plot and error in color/lineup and i don't know what to do i have already attached the file if someone wanna see i want my program to run and show the high pass plot
Mohammad - your attached file does not include the pushbutton2_Callback nor do I see any reference to an f or h. I can reproduce...

environ 7 ans il y a | 0

Réponse apportée
fprintf not displaying in loop
hubert - you may need to clarify what you mean by if its outside of the loop, it prints fine, but not inside. If I run your code...

environ 7 ans il y a | 0

Réponse apportée
how to get sequence of values for 'u' in the for loop using the 'save control.mat u' syntax
Sharath - consider collecting all of the u values in a matrix and then saving it to file afterwards. For example, % your code ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
I need help with my GUI
saeeda - rather than using a loop to capture your images, consider using a timer that executes every five. (By the way, a proble...

environ 7 ans il y a | 0

Réponse apportée
function J= GA_PID(kpid,opt) Error: Function definition not supported in this context. Create functions in code file.
Lin - I observe that same error message if I copy your code and paste it into the MATLAB command window. The error message is te...

environ 7 ans il y a | 0

Réponse apportée
why my picture is 0s ?
Bekhtaoui - you say that the function "my_sct" takes an image like input(image2 result from another program). What does this oth...

environ 7 ans il y a | 0

Réponse apportée
Unable to get correct 2θ value from tan2θ = (2*a12)/(a11-a22) by writing as p= A(1,1) - A(2,2) q= 2 * A(1,2) theta = atan (p/q).Please help
Amar - I think that you should have q/p instead so that theta = atan (q / p) and theta will be -0.9272. Not sure if you still ...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Serial interrupt to automatically update edit boxes,
Corne - in the line of code where you assign the callback, you need to make clear that another parameter is to be pased in. This...

environ 7 ans il y a | 0

Réponse apportée
Patch - Not enough input arguments
Axel - from patch you need to either provide a C the polygon colour specified as a scalar, vector, matrix, or a color name which...

environ 7 ans il y a | 0

Réponse apportée
How to delete a pushbutton with a given 'String' from a .fig file
Pankaj - yes, I see that button. I also see, in your m file, lots of pushbutton callback function that have no bodies which seem...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Periodic function. How would I make this function repeat itself for, let's say, -1 to 3 seconds or something?
A for loop could be used. Perhaps something like for t=-1:3 % use t in your code end

environ 7 ans il y a | 0

Charger plus