Risposto
How can I keep figure boxes from popping up while running script.
Are you wanting to save the plot created on each pass of your loop? If so, just move the figure creation line out of the loop. A...

oltre 9 anni fa | 0

| accettato

Risposto
how can i add noise to the image??
Do you have the image processing toolbox? If so, you might find *imnoise* useful. http://www.mathworks.com/help/images/ref/im...

oltre 9 anni fa | 0

Risposto
Can a function inside a parent code access the full workspace of that parent code?
A nested function can access the variables stored in the workspace of its caller function: function x = outer_function(a,b)...

oltre 9 anni fa | 1

| accettato

Risposto
How to include a conditional function inside a "for k = 1 : 200" loop?
Yes, you need to pass the k value, and any other values used from the calling function, into your function that you call within ...

oltre 9 anni fa | 1

| accettato

Risposto
how can store string and number in a matrix?
You can use a cell array for storing values of differing datatypes: A = {'matlab' 'ver' 12} You can also use a cell array ...

oltre 9 anni fa | 0

Risposto
Is it possible to configure data in a excel file from matlab? If so, How can I do it?
Do you want the timestamp (22:57:13) to be split into separate rows or placed all in the same column? Either way, a combinati...

oltre 9 anni fa | 0

Risposto
Need help inproveing function...
Does this do what you want? >> x = [1 1 3 5 4 6 6 1 9 1 1 8 2 5 5 5 2 7 7 2 2 2]; >> idx = cumsum([1 diff(x) ~= 0]); ...

oltre 9 anni fa | 0

| accettato

Risposto
How to open an axes object inside a GUI ?
If you're asking if this sort of functionality is available without doing your own coding when interacting with axes in figure w...

oltre 9 anni fa | 1

| accettato

Risposto
export output from a linear regression to Excel
You could store your data in a cell array where the first row of elements are the headings (coefficients, r^2, etc.). Then that ...

oltre 9 anni fa | 0

| accettato

Risposto
when using genetic algorithm, the number of variables(nvar) is dependant on the row vector(x) that my fitness function accepts. How can I deal with that?
Have you looked into the *varargin* function? help varargin You could then parse the arguments contained within varargin...

oltre 9 anni fa | 0

Risposto
Help finding the sum of neighboring elements in a matrix?
A 2D convolution should work for your purposes: help conv2 To sum elements, just make your filter a matrix of ones. You...

oltre 9 anni fa | 2

Risposto
nested if else statements
x = 5.5 if x > 6 disp('x is greater than 6') elseif x >= 3 && x <= 6 if mod(x,1) ~= 0 ...

oltre 9 anni fa | 4

| accettato

Risposto
GigE Camera Error: Unable to set PacketSize
Have you tried setting the Packet Size property for your camera? Outside of matlab, you should make sure Jumbo Frames are enable...

oltre 9 anni fa | 0

Risposto
summing up array element
help cumsum >> s = cumsum(p) s = 3 9 11 16

oltre 9 anni fa | 1

Risposto
How to find specifying pattern in the string
It sounds like *regexp* would do what you're wanting. idx = regexp(s,'V[bx]x_') If idx returns anything other than empty...

oltre 9 anni fa | 2

Risposto
ln not recognised as a command
help log If you read the help file for *log*, you'll see that it _is_ the natural logarithm function. *ln* is not a built-i...

oltre 9 anni fa | 2

Risposto
Determine if a value is an Empty Matrix: 0 x 1 and replace with NaN
help isempty Your code would look something like this: if l == 1 fint = intersect(find(b(:,1)==k),find(b(:,2)==...

oltre 9 anni fa | 1

| accettato

Risposto
GUI table, add/remove row buttons
Here's a snippet of code I've used in the past for adding and subtracting rows. I modified it for use with a pushbutton. This as...

oltre 9 anni fa | 0

| accettato

Risposto
Adding fields to struct within variable editor
From within the variable editor window: Right click -> New Then modify the field's value to whatever you like.

oltre 9 anni fa | 0

| accettato

Risposto
Puzzler for a Monday
Here's my solution. It's ugly, but I think it's fairly general. :P function A = cell_shuffle(A) idx = cellfun(@(x)iseq...

oltre 9 anni fa | 0

Risposto
Repeat Try/Catch loop?
You could embed your try/catch statements in a while loop, then check a condition at the beginning each iteration to see if the ...

oltre 9 anni fa | 9

| accettato

Risposto
How to assisgn char data into empty Edit Text in Matlab GUI ?
Assuming you created your GUI using GUIDE: set(handles.edit1,'String',scale)

oltre 9 anni fa | 0

| accettato

Risposto
Attempt to reference field of non-structure array
You need to remove ".txt.", as your test file isn't loaded in as a structure and Matlab is interpreting the period as referencin...

oltre 9 anni fa | 3

| accettato

Risposto
How to call a property?
Does the following work? newVar = fit.Variance;

oltre 9 anni fa | 1

| accettato

Risposto
Plotting a 3-D Function with Interpolated Shading
[X,Y] = meshgrid(linspace(0,1,25), 0:.024:0.5); Z = cos(2*pi*(3.*X - 4.*Y)) ...

oltre 9 anni fa | 1

| accettato

Risposto
How can i compare 2d shapes in mat lab?
In the below example, I'm assuming that you're going to be working with RGB data. That is, I'm assuming that your images aren't ...

oltre 9 anni fa | 0

| accettato

Risposto
Moving between different GUI's (bypassing any intermediate GUI)
Others may be able to comment on the best way to do this using appdata. I have found, however, that simply passing the handles s...

oltre 9 anni fa | 0

Risposto
update GUI from from call back
Does this do it? set(handles.listbox_handle,'String',contents{handles.Selection}) Also, I'm fairly sure that you don't n...

oltre 9 anni fa | 0

| accettato

Risposto
Why does Matlab display different pixel values than other programs?
Shot in the dark here, but could it have anything to do with those programs using 0 indexing while matlab uses 1 indexing? Paint...

oltre 9 anni fa | 0

| accettato

Risposto
Plotting matrix coordinates with indices?
If I understand correctly, I think *imagesc* would work: M = eye(50); %example matrix imagesc(M)

oltre 9 anni fa | 0

Carica altro