回答済み
I need two outputs and I'm only getting one, please help me
You didn't actually assign any outputs, so Matlab only stores the first one in ans. If you want to actually store variables you ...

6年弱 前 | 0

回答済み
What is the probability that their children can travel in a straight line between any two points without leaving the boundary? In other words, what is the probability that the boundary is a convex quadrilateral? 
If you want to do a Monte-Carlo-style simulation, I would suggest using rand to generate the coordinates. I would suggest puttin...

6年弱 前 | 0

回答済み
Annually averaging of a 4D matrix
You are using the color operator incorrectly. 1:2:3 doesn't mean [1 2 3], but [1 3]. If your syntax does indeed work for you, t...

6年弱 前 | 0

| 採用済み

回答済み
finding a phrase in a modularized code with over 1000 functions
You can use Matlab tools, as Ameer describes, but you can also use external software. I personally find the performance of searc...

6年弱 前 | 0

回答済み
How to plot data with >2 dimensions?
Apart from plot3 (as Alan suggested), you may also consider using subplot to divide the different scenarios and using hold to pl...

6年弱 前 | 0

質問


minify Matlab code (minimize number of characters)
I would like to find a way that reduces the footprint of a function as much as possible. The actual functionality should not cha...

6年弱 前 | 2 件の回答 | 2

2

回答

回答済み
How can I get my figure window to pop up with the animation playing when I execute the code?
You probably mean you want to make the figure the current figure and bring it to the foreground. If so: figure(1) cla;%i...

6年弱 前 | 0

| 採用済み

回答済み
Find the element that is a sqrt of another element in the same array function?
To compare many elements to each other I would recommend the ismember function.

6年弱 前 | 0

回答済み
Refresh annotate on figure in loop
Create the annotation object once, and update the String property inside your loop. I would suggest drawnow to trigger the upda...

6年弱 前 | 0

回答済み
Locate elements of a vector inside a meshgrid
I would suggest using ismembertol, or consider functions like normxcorr2 from the image processing toolbox.

6年弱 前 | 0

回答済み
How do I read this file and extract the data to plot and average it
Good call on not using str2num, you should consider using str2double (or textscan or datetime) instead: [date,value]=read_json_...

6年弱 前 | 0

回答済み
clean all paths except factory ones (toolboxes)
Appart from using restoredefaultpath, you might consider borrowing code from toggleToolbox to toggle the states of your path.

6年弱 前 | 0

回答済み
How do I create an exact looping code for my following problem?
You are remove all elements from phi, so your second iteration does what you ask: nothing. Please learn how to use the debuggin...

6年弱 前 | 0

回答済み
Crop a part of binary image
My suggestion would be to determine the number of white pixels in each column, and use an automatic way to determine a threshold...

6年弱 前 | 0

| 採用済み

回答済み
I'm having problem while running a code with nested for loops. I'm not able to generate the output graph
I'm not going to read your code when it is like this, but the most common source of the issue is that people are not indexing th...

6年弱 前 | 0

回答済み
What is it called when I specify a vector output of solutions from, say, fsolve?
Those are called output arguments. Sometimes functions will use the nargout function to determine which calculations should be p...

6年弱 前 | 1

| 採用済み

回答済み
Output argument "xn" (and maybe others) not assigned during call to "myGeneralRecursion".
You're close with the components of your function, but you're not quite there. Your function is trying to find a value for xn. I...

6年弱 前 | 0

回答済み
Importing a two column array from excel
You forgot to put the quotes in your first call. That makes Matlab treat it like a variable, not a char array.

6年弱 前 | 1

回答済み
how to make a looping function to delete all members in a phi set?
You don't update the original variable, but you create a new one instead. You also have made a typo when writing the code here, ...

6年弱 前 | 0

回答済み
Fast subsetting or indexing of data
Whenever you find yourself copy-pasting code in Matlab, you should consider an array. seasons={'Spring','Summer','Autumn','Wint...

6年弱 前 | 0

| 採用済み

回答済み
What frustrates you about MATLAB? #2
Comment posted by John in the previous thread: Matlab should 'update' the new version instead of installing the new version. Th...

6年弱 前 | 1

回答済み
How to read data from a file into cell array keeping indents undisturbed
You can get my readfile function from the FEX or through the AddOn-manager (R2017a or later). It will read a file to a cell arr...

6年弱 前 | 3

回答済み
How to asign Unicode string to popup menu without fonr error?
Since you're using a release pre-R2020a, the default to store m-files is not UTF-8. That means any special character has a very ...

6年弱 前 | 0

| 採用済み

回答済み
SOS: How do I get the same amount of positive and negative values in a random vector?
Your question differs from your description. If you want to select the points with both x and y above 0, you need to use both as...

6年弱 前 | 1

回答済み
bug in power calcultion while in loop ?
This is not a bug. Look at the exponent: 2e-16 is very small. It is close enough to eps that you can assume that is just 0. The...

6年弱 前 | 1

| 採用済み

回答済み
Reshape panel data to wide using text scan
If you want to read an Excel file you can use the aptly named xlsread function. The second or third output is probably what you ...

6年弱 前 | 0

回答済み
Redistribution of histogram type data in specified bins
You should be really careful with this resampling, especially for so few samples. Since you're assuming a flat distribution in ...

6年弱 前 | 0

回答済み
Need help with perimeter of polygon
Step by step. Split up your problems in manageable parts. If you have the coordinates of all corners of your polygon, you can u...

6年弱 前 | 0

回答済み
matlab calculation area circular
You can use trapz for a numerical approximation of an integration. By selecting your bounds you can use this to calculate the ar...

6年弱 前 | 2

| 採用済み

回答済み
Code is not working, can someone help me?
This should fix it: function s = Sum1(x,y,z) s = 0; for i=0:min(x,y) for k=0:x-i s = s + (-1)^k * QuantumDi...

6年弱 前 | 1

さらに読み込む