Réponse apportée
Index exceeds the number of array elements (1264).
Karlie - f iterates from 1 to the length of your x array. This is fine except for s(i)=x(i)+x(i+1); because when i (and you co...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Index in position 1 is invalid. Array indices must be positive integers or logical values.
Yoke - what is f? You seem to be treating it like a matrix at b=y(i); a=x(i); f(a,b)=(a+b)^2; but this fails since (on the f...

environ 7 ans il y a | 0

Réponse apportée
How to divide square image into rectangle with different size?
Syahirah - first, your code row=size(Pic,2) column=size(Pic,1) is mixing up the dimensions (I know that this matrix is a squa...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
If i want to use the other m.file in a single m.file,is there any instruction code i can use?
If your codeA, codeB, and codeC are functions (instead of scripts), then you can call one from the other. See Scripts vs Functio...

environ 7 ans il y a | 0

Réponse apportée
Function to display polynomial based on user input
MItchell - I think that you are confusing some of your variables as exponents. Wouldn't the code be more like fprintf('y=%d(x)...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Slow-running code for removing rows
Christian - what about using find as slopes(find(slopes(:,1)==0), :) = [] We use find to return all indices of the first colum...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
How can I average the first 14 columns, the second 14 columns, and so on and so forth?
Natasha - so if you were to do this by hand, you would do something like iteration column start column end ========= ===...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
Homework help, displaying a matrix with a loop
Matthew - since this is homework... to get the number of rows of lake_powell use size and then a for loop to iterate over each r...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
fprintf in a loop
Matthew - you could use a for loop instead years = 2013:2016 for k = 1:length(years) % your code fprintf('\n During...

environ 7 ans il y a | 0

Réponse apportée
How to change global variable value with radio button?
Angga - instead of putting your radio buttons in a panel (which I think you may have done but I can't be sure) you would use a B...

environ 7 ans il y a | 1

Réponse apportée
How can I put these subplots into a for loop?
Maria - for each of your two blocks of code, look at each line and ask yourself "what is different?" The part that is different ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Stackedplot of a multi-column tametable: how to plot each line with a different color
You may be able to change the colours of each line after you have called stackedplot. For example, you might (and I say might be...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
Unexpected MATLAB Expression on function
burke - it looks like your second input parameter (in the function signature) is a number. Input parameters must start with an a...

environ 7 ans il y a | 0

Réponse apportée
fname='meta_Electronics.json'; fid=fopen(fname); fopen=fread(fid) str=char(raw'); fclose=(fid); val=jsondecode(str);
Sophiya - since you are not providing the full path to your file, it could be that the file cannot be found (perhaps not in the ...

environ 7 ans il y a | 0

Réponse apportée
Equalizer undefined variable problem
Hassan - is code referencing wavplay from the File Exchange (the inputs seem to match)? If so, have you downloaded the code and ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Calculating angles greater/smaller than +-pi/2 with only x,y coordinates
Julius - have you tried using atan2 which returns values in the closed interval [-pi,pi]?

environ 7 ans il y a | 0

Réponse apportée
How to convert cell array to ordinary array 3x5 cell array
ahmed - please clarify what you have posted above. It looks like you have a 3x5 cell array so what do you want to convert into t...

environ 7 ans il y a | 0

Réponse apportée
How to use a for loop to generate function inputs
pldr-bny - you could try something like numberOfImageSets = 81; imgSets = cell(numberOfImageSets,1); for k = 1:numberOfImageS...

environ 7 ans il y a | 0

Réponse apportée
Plotting error bar plot error bar plot for Monte Carlo simulation
Katie - your above code calls randn('state',100) which will always "use" the same state of the generator...so the same sequenc...

environ 7 ans il y a | 0

Réponse apportée
reading image files in a sequence
navin - don't create variables dynamically (which is what you intend to do with variables names l1, l2, l3, ...). See Stephen's ...

environ 7 ans il y a | 1

Réponse apportée
Real time plotting - Matlab GUI
George - whenever you call plot like with plot(grab_avg_time,grab_avg, '--*') you are creating a new graphics object and so it...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to create a matrix with arbitrary dimensions
Michael - this seems like a homework question so see zeros or ones for how to create a matrix of zeros or ones respectively. And...

plus de 7 ans il y a | 0

Réponse apportée
Pulse and Glide Looping Problem
Alex - a couple of things. This code x=zeros(length(theta)),1; %initial dispacement [m] v=zeros(length(theta)),1; %initial V...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I use a checkbox value to determine whether to clear other elements in App Designer?
Jacob - your arrays like ef=[app.ef1.Value,app.ef2.Value,app.ef3.Value,app.ef4.Value,app.ef5.Value,app.ef6.Value,... a...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I delete the repeated values and keep just a row of each one?
DS - you could try unique(sort(A,2), 'rows') where A is the matrix that you have defined above. This could be inefficient tho...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Getting 'Argument must contain string error' error when saving, it's always worked before
Nathaniel - perhaps the error is with the second input parameter save([folder4Mfiles,'\Position_File.mat'],X) where you should...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Needing help with using newton raphson method to find roots
Anthony - your abovecode seems to be the Bisection method. For Newton's Method, your code should just take an initial guess and ...

plus de 7 ans il y a | 0

Réponse apportée
Switch to write programs
Yu - rather than creating using a switch control with cases for each of the 100 integers, you could just create a cell array of ...

plus de 7 ans il y a | 1

Réponse apportée
Bisectional method Not always giving correct roots
Anthony - can you provide an example (with inputs) that gives the correct solution and an example that doesn't? Also, don't you ...

plus de 7 ans il y a | 0

Réponse apportée
Hello, a error has come in my s-function kindly help me....
Abdul - in the chap1_1ctrl function, you have the following code case 3, sys=mdlOutputs(t,x,u,J); where you are p...

plus de 7 ans il y a | 0

Charger plus