Discussion


How to create a GUI
There are multiple ways to create a graphical user interface (GUI) in Matlab. Which method is the best depends on multiple facto...

presque 7 ans il y a | 6

Question


How to create a GUI
There are multiple ways to create a graphical user interface (GUI) in Matlab. Which method is the best depends on multiple facto...

presque 7 ans il y a | 4 réponses | 6

4

réponses

Réponse apportée
GUI stops after initialization code
Did you notice this line? % Begin initialization code - DO NOT EDIT They weren't kidding. It is easy to mess up GUIDE-created ...

presque 7 ans il y a | 0

Réponse apportée
Making a cell array of DICOM headers.
It seems that there is a function called spm_dicom_headers that will get the dicom header in the correct form. I would assume it...

presque 7 ans il y a | 0

Réponse apportée
Trouble with spikes.
Here you can see the power of Matlab. What you want can be in a few short lines of code: x=rand(2112,2688); avg=mean(x);%or ...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Select positive values around a certain value
If you happen to have the image processing toolbox: A = [-2 1 0.5 -34 4 5 9 3 1 -3 -2 6 -7]; B = 3; labeled=bwlabel(A>0); L=...

presque 7 ans il y a | 2

| A accepté

Réponse apportée
GUI output of structure generated by running a script
This is a good example of why you should be using functions. Your script is actually a function that could also be setting some ...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
multiple variables into a cellfun
This sounds like a perfect situation for the ismember function.

presque 7 ans il y a | 0

Réponse apportée
How to Create a Table in MATLAB R2013a
Do you mean the table data type or data printed to a file/command window formatted to look like a table? In case you mean the t...

presque 7 ans il y a | 0

Réponse apportée
How to define a variable which is numerical and changes in every cycle of the while loop?
You should not have an array input to an if or while. Your second conditional could do with some edits. To solve your actual ...

presque 7 ans il y a | 0

Réponse apportée
listdlg showing extra line
There is probably a char 10 or 13 in there. On newer releases it will show a return symbol in the variable editor, but I don't k...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
problems with import txt files as Matrix
Read the file as text (e.g. with the textscan function), replace the comma with a point and convert the char array to double. Th...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
What code to make figure window fullscreen with subplot?
You can use my maximize FEX submission, and/or if you're using R2018a or later you can set the WindowState property (see the doc...

presque 7 ans il y a | 2

| A accepté

Réponse apportée
How to do a baseline correction
You mean like a simple subtraction? t=linspace(0,10,100); bias=@(t) t/9; P_fun=@(t) 0.1*(t-3).^2+sin(t/2)-0.85 +bias(t); P=P...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Find where line crosses y = 1 and y = 0
Basic algebra which doesn't have a lot to to with Matlab: A=4;B=9;%example input y=[0 1]; x=(y-B)./A; clc,disp(x)

presque 7 ans il y a | 1

Réponse apportée
How to resize a 4D Matrix
You misunderstood the syntax of the FEX submission imresizen. The second input is a scaling factor, meaning your syntax should l...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Creating Gui in matlab
I would recommend not using GUIDE. The point where GUIDE will be removed from Matlab is now on the horizon, and you shouldn't be...

presque 7 ans il y a | 0

Réponse apportée
How can I get a first value of each index from the other column?
Use unique to get the list of first indices, the use either find or min in a loop.

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to integrate a plot over specified range?
As you indicated with the tags, using trapz is also an option. fun_x_of_t=@(t) sin(t); fun_y_of_x=@(x) cos(x); fun_y_of_t=@(t...

presque 7 ans il y a | 1

Réponse apportée
Load in all files of a folder?
Use dir to generate a file list (you can use ** to search a folder tree), then use a loop to process all files one by one.

presque 7 ans il y a | 0

| A accepté

Réponse apportée
What is the return key mac
You could check if char(10) or char(13) would work.

presque 7 ans il y a | 0

Réponse apportée
How to horizontally align multiple lines ylabel
(untested idea) You can trick the alignment by making sure the square bracket part is the middle line. To achieve this you ca...

presque 7 ans il y a | 0

Réponse apportée
Sort a structure by the date field
Don't concatenate to a cell, but to an array: examplestruct = struct; for i = 1:5 examplestruct(i).data = rand(1,10); en...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How can I find the maximum value and time array in MATLAB?
Use the second output of max: a = [1 2 ; 4 5 ; 7 8 ; 6 11 ; 4 3 ]; [val,ind]=max(a(:,2)); time_val=a(ind,1);

presque 7 ans il y a | 1

Réponse apportée
plotting a function from an m file
You forgot to add 100 in your actual code: plot(x,f(x,100)) You should avoid using sum as a variable name, because it sh...

presque 7 ans il y a | 0

Réponse apportée
Saving structure as a .mat file with matrices, strings and numbers
There are two issues here. If you read the doc it specifies that the struct must be scalar (each field is allowed to be any type...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to increment a subscript in Matlab using the ylabel function?
The syntax you are attempting to use would work if you're using strings. However, you are using char arrays. Either switch to a ...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to code fprintf on multiple lines ?
As far as I'm aware this should work with strings as well, but I frequently use a setup like this with a char array instead. So ...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Insert PNG image into normal image
If you want to prevent overwriting the underlying image for some pixels, you can use a logical mask to only overwrite some pixel...

presque 7 ans il y a | 0

Réponse apportée
Write data to text file
This is probably due to Matlab being column-based, instead of row-based. This may result in counterintuitive results if you ente...

presque 7 ans il y a | 1

| A accepté

Charger plus