Risposto
Matlab File not running when selected from a Zip file
Although Windows explorer can treat zip files as if it is a folder, Matlab does not. You will have to extract all required files...

quasi 7 anni fa | 0

| accettato

Risposto
Finding minimum points in a plot.
The movmin function might work for you. If you want us to help with the tweaking, you will have to attach your data or some code...

quasi 7 anni fa | 0

Risposto
How can I do such a "averageifs"(excel) process in Matlab?
Using accumarray is probably better, but you can also use the unique function and a for loop to find the sum and the count. Edi...

quasi 7 anni fa | 0

| accettato

Risposto
Conditional if statement solution
In Matlab calculating parameters for the entire array at once is almost always faster than a loop. My code below uses the find f...

quasi 7 anni fa | 2

| accettato

Risposto
Pie chart without labels
No need for fragile findobj(ax,__) calls (which may return a lot more than just the pie labels). You can either set the labels t...

quasi 7 anni fa | 2

| accettato

Risposto
How to arrange coordinates into 3 columns?
If you want to linearize an array, you can use (:): [XP_NODES,YP_NODES,ZP_NODES]=deal(XP_NODES',YP_NODES',ZP_NODES'); MESH = [...

quasi 7 anni fa | 0

| accettato

Risposto
How to reset military datetime in matlab?
As you can read in the doc, the hh identifier is a 12h system. If you want 24h, you need to use HH in your format.

quasi 7 anni fa | 2

Risposto
Solving 3 x 9 matrix all posible combinations
There are 4686825 possible combinations, so I would recommend not storing all of them, especially not in numbered variables, whi...

quasi 7 anni fa | 0

Risposto
Same colormap with colorbar which has two axes
You can add a second tick row on the right side of the colorbar using the code below. f=figure; image c_handle=colorbar; %...

quasi 7 anni fa | 0

Risposto
Question about imgaussfilt3
I don't see any indication otherwise in the doc, so you can safely assume that the sigma is in units of voxels. This should be e...

quasi 7 anni fa | 0

Risposto
Modifying a structure array
Since you don't provide any indication of how you want this to work for struct array input, you'll have to modify this code your...

quasi 7 anni fa | 1

Risposto
3 demension matrix coding - find largest NN elements
You will probably need to loop through the pages. The second output of max should be what you need. A=rand(4,4,5); out=A...

quasi 7 anni fa | 0

Risposto
Can't take the mean of a 2D matrix (Array indices must be positive integers or logical values.)
You are using mean both as a function name and a variable name. Also, if you read the doc for mean, you will notice you can e...

quasi 7 anni fa | 1

| accettato

Risposto
Loading from Workspace via string
The matfile function has an interface similar to what you're looking for. You do need to be careful with indexing if you want to...

quasi 7 anni fa | 0

| accettato

Risposto
Replace multiple values in matrix / image
You can use ismember to remove a loop. I put in a loop over the colors, but since that is only 3 iterations, that will not cause...

quasi 7 anni fa | 0

| accettato

Risposto
Replace specific string in structure
This should do the trick: %create part of your data structure as an example EEG=struct; EEG.event(1).type='11';EEG.event(1).l...

quasi 7 anni fa | 0

| accettato

Risposto
how to assign a number to a specific location.
I'm going to assume you want to treat table 1 as your lookup table, where you want matching column indices to have matching valu...

quasi 7 anni fa | 0

Risposto
extracting number from a string
You can either use ismember to determine which positions contain the characters you're looking for, or you can use isstrprop. Th...

quasi 7 anni fa | 0

Risposto
Workspace calculation accuracy 7 characters
There is a big difference between the display of values and how they're stored. They aren't stored in a decimal form (maybe with...

quasi 7 anni fa | 1

| accettato

Risposto
Convert axis to image file/matrix
As KSSV mentions, print(gcf,'test','-dpng','-r300'); should do the trick if you want to print your entire figure content to a pn...

quasi 7 anni fa | 0

| accettato

Risposto
How to get a centerline from a contour ?
First let's load the image into a usable format. You already have code to get binaryImage, so you can use that. %% read image ...

quasi 7 anni fa | 0

| accettato

Risposto
How to run 'dicomanon' on all '.dcm' files in a directory (including all subfolders)?
Use the dir function to generate a full file list and then loop through them. list=dir('C:\path\**\*.dcm');

quasi 7 anni fa | 0

Risposto
How to write this in matlab?
Because of the recursion limit (and other factors), it is smarter to implement this in a loop, instead of a recursive function. ...

quasi 7 anni fa | 0

Risposto
Problems when running GUI graph plotting with 'while' or 'if' loops
You should be using strcmp to test if a char array is equal to another char array. Your current tests are array operations. A...

quasi 7 anni fa | 0

| accettato

Risposto
how to insert 1 in place of inf in a given array
You can use the diff function and isinf to make this array. final= [false diff(array)==0] | isinf(array) ;

quasi 7 anni fa | 2

| accettato

Risposto
how can i reduce the numer of vertices of tetrahedron by keep the shape approximately same
The <https://www.mathworks.com/help/matlab/ref/reducepatch.html reducepatch> function should do just that: reduce the number of ...

quasi 7 anni fa | 2

Risposto
How can I take moving average with different window shapes?
You can use the conv function to calculate the convolution of your window with your data. Just make sure your window has a sum o...

quasi 7 anni fa | 0

| accettato

Risposto
How can I remove the toolbar from the axes, but keep it at the top of the window?
In the same thread image analyst refers to, you can also find <https://www.mathworks.com/matlabcentral/answers/419036-what-happe...

quasi 7 anni fa | 2

Risposto
Is there a program that allows a user to run a matlab script outside the software?
To my knowledge you have only a single option besides Matlab: GNU Octave. It has a number of major downsides (lack of speed, ...

quasi 7 anni fa | 1

Risposto
i cannot copy figure
Apart from an external screenshot tool, you can also use the <https://www.mathworks.com/matlabcentral/fileexchange/23629-export_...

quasi 7 anni fa | 0

| accettato

Carica altro