Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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 ...

oltre 7 anni fa | 1

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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,:);

oltre 7 anni fa | 0

| accettato

Risposto
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 ...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 2

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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 ...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

Risposto
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,...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 1

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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.

oltre 7 anni fa | 0

Risposto
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 ...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 1

Risposto
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...

oltre 7 anni fa | 1

| accettato

Risposto
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*...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 2

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 2

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 2

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Carica altro