Réponse apportée
Matlab code to psudocode
I will do you one better: I will write comments with each line, which the writer of this code should have done. Then you can eas...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How I can fix "Matrix dimension must be agree"
Your error is due to the sizes not matching. This can be solved using implicit expansions, which is automatically enabled since ...

plus de 7 ans il y a | 1

Réponse apportée
Matlab App designer - use 'close all' without deleting GUI
You can use handles returned on the opening the figure to close them: f=figure; %some interaction with the figure plot(rand(2...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
help understanding cell and (end+1) use
The end keyword (when used in indexing) is converted to the size of that dimension. %example: A=rand(1,2,5,3); A(1,1,end,1)=2...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How do I assign part of a matrix to be a variable
data=rand(9,10);%generate some random data a=data(1:3,:); b=data(4:6,:); c=data(7:9,:);

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
read file with ascii characters and binary data on one single line
If you are on Windows and opening the file with notepad a line feed (ASCII 10) is not enough to trigger a new line, as you will ...

plus de 7 ans il y a | 0

Réponse apportée
Histograms - Mean calculation - Comparing more pdf
For your first question: you can either use a categorical array, or set the xticks and xticklabels. You can calculate the progr...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to put in the fprintf command without data printing limits.
Normally I am opposed to providing turn-key solutions to homework, but in this case I feel that the best way to explain is to sh...

plus de 7 ans il y a | 2

Réponse apportée
For loop not terminating when condition is met
Since Matlab stores values in a non-decimal representation, there is a lot of potential for round. In general you should be usin...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Calling variables from a GUI into a script
You shouldn't be using a script, but you should use a function instead. That way you have encapsulated the process. You can use ...

plus de 7 ans il y a | 0

Réponse apportée
How could I passing parameters from .m file to GUI
You shouldn't change the function headers that GUIDE generates. The fact that your function is not in the same file doesn't matt...

plus de 7 ans il y a | 0

Réponse apportée
Wrap in a legend with num2str
If you use a newline character ( char(10) ), you can wrap the text. Here is some example code: figure(1),clf(1) h=plot(rand(1,...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to write txt file contain double array and text header?
You can use repmat or sprintf to construct the FormatSpec. array=rand(3000,48); fid=fopen('test.txt','wt');%opening with the...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Cannot load MATLAB file properly
The dataset class is part of the Statistics (and Machine Learning) Toolbox according to the doc. So you will either need to re-i...

plus de 7 ans il y a | 1

Réponse apportée
Plot frequency along the y-axis without using a histogram
Please don't delete a question because you're not getting the feedback you want. Since you didn't provide any example data, I'l...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Tracking the size of a variable
Yes. Set a break-point at the beginning of your function and go through your code step by step.

plus de 7 ans il y a | 0

Réponse apportée
Finding the closest neighbouring coordinates in 3D
As suggested here, if you have the statistics toolbox, you can use the pdist function. If you have more structured data (e.g. a ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
find the minimum RGB values of a pixel from an image
You mean like this? RGB=uint8(255*rand(100,100,3));%random RGB image temp_IM=sum(double(RGB),3);%sum the three color channel...

plus de 7 ans il y a | 1

Réponse apportée
Calling nonlinear constraints before objective function
You could let your objective function return inf when invalid parameters are provided. Then any minimizer will avoid values resu...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
v(t) is not defined help me!
This code should work: m=70; g=10; c=10; t=0; v=0;n=0; while t<7*log(100) t=t+0.1; n=n+1; v(n+1)= v(n)+0.1*...

plus de 7 ans il y a | 0

Réponse apportée
retrieve binary data back
In case you wanted to accept my answer, I'll repost my code in an actual answer. However, I would suggest you use Madhan's solut...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
i created function works on 3*3 matrix how i make it work on 9*9 mat with loop?
This should work better: function tf=checkunit(a,tol) %Check matrix for unique values %This function returns true when no dup...

plus de 7 ans il y a | 0

Réponse apportée
replace duplicate entry in columns
I expect this code does what you want. The order in which the array is processed matters, so you need to make sure that this sat...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
how to display / recall data in matlab
As long as the input array A has sufficiently unique values, you can use either ismember or ismembertol. A=[10 20 30 40 50] bl...

plus de 7 ans il y a | 0

Réponse apportée
Flow of information in callback functions
You can find some more information in the documentation. The @ creates a function handle. There are two options here: an anonym...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Circle interpolation (calculate the values inside)
If you want to fill a circular area with a particular color, you can use this code: center=[10,20];%xy coordinates of the cente...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Why can't i plot a graph for a against t?
Here are some variations you could try: k_n= 7*10^-11; n= 2; i=1; dt=1/3600; %1sec interval t=zeros(1,floor(2.5/dt)); %in h...

plus de 7 ans il y a | 2

Réponse apportée
How to loop over a series of files
Your mistake was numbering your variables. However, you can use eval to solve your current problem. You should avoid eval. Make...

plus de 7 ans il y a | 0

Réponse apportée
Running average using for loops
I guess boldly: If you want a sliding window average, you can use a convolution: data=magic(8);data=data(:);%generate some dat...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
how to modify contrast in multiple dicom images using slider GUIDE
You can use the callback of the slider to adjust the caxis. In my FEX submission WindowLevel I do something similar, but with d...

plus de 7 ans il y a | 0

| A accepté

Charger plus