回答済み
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...

30日 前 | 0

| 採用済み

回答済み
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 ...

30日 前 | 0

回答済み
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...

30日 前 | 0

回答済み
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,...

30日 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 1

回答済み
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...

約1ヶ月 前 | 1

| 採用済み

回答済み
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.

約1ヶ月 前 | 0

回答済み
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 ...

約1ヶ月 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 1

回答済み
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...

約1ヶ月 前 | 1

| 採用済み

回答済み
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*...

約1ヶ月 前 | 0

回答済み
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...

約1ヶ月 前 | 2

| 採用済み

回答済み
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...

約1ヶ月 前 | 0

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 0

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 2

回答済み
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...

約1ヶ月 前 | 0

回答済み
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...

約1ヶ月 前 | 2

| 採用済み

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
Excel and MATLAB connection
You can use xlsread to read data from Excel in your code. I would avoid the use of ActiveX whenever you can avoid it. You can fi...

約1ヶ月 前 | 1

回答済み
Average of a single element in an array
The best method depends on how you have generated your array. I will show two examples below. %example 1: only integers A=rand...

約1ヶ月 前 | 1

| 採用済み

回答済み
How can I rotate the lines on an image
You can use code similar to that below. I changed the step size to 30 degrees to make it more clear what is happening. clc cen...

約1ヶ月 前 | 0

回答済み
how to sum of each row according to values values in given function
You can do something like the code below. You could use a for loop instead of the call to cellfun, but as you can see, you don't...

約1ヶ月 前 | 2

| 採用済み

回答済み
how to estimate bright channel for color image in Matlab??
Below you find 2.5 strategies. The first should be a lot faster, especially for larger images. With the last it is easier to see...

約1ヶ月 前 | 0

回答済み
Please advise me on how to improve the efficiency of this code?
You could use an explicit dialog box to avoid any confusion: answer = questdlg(... 'Do you want to try again?', ...%questi...

約1ヶ月 前 | 0

回答済み
Working with dicom images
You need to convert to either a double or a int16 (before applying the subtraction). The latter only has a maximum half as high ...

約1ヶ月 前 | 0

| 採用済み

回答済み
Using a While loop to determine number greater than a constant
I'm a bit hesitant to provide you with a complete working solution, since you mention it is homework. I will give you some advic...

約1ヶ月 前 | 0

Load more