Answered
GUI display value from child form to parent form
The general strategy is clear: The 2nd GUI must find the first one, to address the wanted uicontrol. You can either provide the ...

9 years ago | 0

Answered
Error: Subscripted assignment dimension mismatch.
In v(i)=[vi(i),vj(i),vk(i)] you try to assign a [1 x 3] vector to the scalar v(i). This cannot work. You do not need ...

9 years ago | 1

| accepted

Answered
Extracting selected string from popupmenu
Perhaps you mean: strv = get(handles.popup1, 'String'); value = get(handles.popup1, 'Value'); set(handles.longedit, ...

9 years ago | 1

Answered
get a diagonal line in matrix
Or: a = [1 2 3; 4 5 6; 7 8 9]; s = size(a); index = (numel(a) - s(1) + 1):(1 - s(1)):s(2); b = a(index...

9 years ago | 0

| accepted

Answered
Create Unique Randomsample 1000 times
a = zeros(n, 50); for i =1:n a(i, :) = sort(randsample(100,50)); end [EDITED] Or do you mean that the rows shoul...

9 years ago | 0

Answered
the lines of graph doesn't appear at matlab
You draw the lines in 'w': White line on white background. Try this: semilogx(nb,vbr1,'r', nb,vbr2,'b') Note: You do not...

9 years ago | 0

| accepted

Answered
Run a function into a function
The question is not really clear. I assume that this is very basic and suggest to read the Getting Started chapters to learn the...

9 years ago | 0

Answered
return iteration number from selected for loop value?
Find the index with the minimal distance of dx and a given value: adx = 201.8842904397075; [~, index] = min(abs(d...

9 years ago | 0

| accepted

Answered
I made a Matlab GUI through guide, and almost everything is working but I think something is wrong with my callbacks. Any help would be greatly appreciated.
It is a very ugly idea, to define a callback like this: '@(hObject,eventdata)MainGUI(''updateAxes'',hObject,eventdata,guida...

9 years ago | 1

| accepted

Answered
How to use GUI to change a value of a variable and use that variable in a script
You can either use GUIDE or create the GUI prgrammatically by code. Perhaps a simple inputdlg, questdlg or listdlg is sufficient...

9 years ago | 0

Answered
Plotting a spectrum-like figure
Perhaps you mean: time = 0:100; % Test data freq = 0:30; data = rand(numel(freq), numel(time)) .^ 2; surface(t...

9 years ago | 0

Question


How to shrink a pre-allocated array in a C-Mex?
What is a fast and secure way to shrink a pre-allocated array inside a C-Mex function? #include "mex.h" void mexFunction...

9 years ago | 1 answer | 0

1

answer

Answered
Matlab Compiler is not linked to Matlab
The MCRInstaller is not started from inside Matlab. It is the idea of the Matlab runtime and compliled application to run indepe...

9 years ago | 0

Answered
when i run M script automatic MATLAB are close how can i solve this problem ?
The message contains this: Caught unexpected exception: InterruptException(ctrl-c) This means, that you hit Ctrl-C and th...

9 years ago | 0

| accepted

Answered
Ignoring IF statements error
I do not see any problem in your code. It does exactly, what is expected. Here a brushed up version: suma1 = 0; sum...

9 years ago | 0

| accepted

Answered
Union of closed intervals
Version 3: Do not create the sorted array explicitly: function u = unify_intervals(s) [~, index] = sort(s(1, :), 2); %...

9 years ago | 0

Answered
Union of closed intervals
A version using a C-Mex function: function u = unify_intervals(intervals) [~, index] = sort(intervals(1, :), 2); u ...

9 years ago | 0

Answered
Union of closed intervals
Start with a pre-allocation of the output instead of the iterative growing. Then update |Head| on demand only. % sort inter...

9 years ago | 2

| accepted

Answered
Clipping 3D mesh along boundary, interp1 problem
Do you want to set all points outside the boundary to NaN? K = boundary(x, y); % Or with a matching shrink fa...

9 years ago | 0

Answered
Why not use square brackets?
An equivalent effect occurs in |for| loops: v = 1:1e5; r = zeros(1, 1e5); tic; for loop = 1:1000 for k = v ...

9 years ago | 1

Answered
How to remove whitespace around subplot figures?
I'd expect that PDF or EPS are a better format for embedding graphics in a LaTeX report. Instead of cropping the PNG, you can...

9 years ago | 2

Answered
How to change X in xlabel to italic font ?
xlabel('Distance, $X$', 'FontName', 'Times New Roman', ... 'FontSize',28,'Color','k', 'Interpreter', 'LaTeX') or ...

9 years ago | 1

Answered
Matlab runtime should provide static libraries instead of shared libraries
This is the public Matlab forum, where other Matlab users post answers in general. We cannot change the way Matlab produces libr...

9 years ago | 0

Answered
Display axes through origin in Gui
Do not set the axis-location of the plotted line object, but of the axes: axes(handles.axes1) plot(x,y) grid on ha...

9 years ago | 0

Answered
How to loop through an array that contains multiple arrays within the cells
* Do not add the folder of the data file to Matlab's |path|. Use absolute file names instead. * You do not need the names of th...

9 years ago | 0

Answered
Can I get Matlab free trial for use as an independent contractor?
This is the public forum and not the official support of MathWorks and most of the answers are given by other Matlab users. Only...

9 years ago | 0

| accepted

Answered
End line taking up time in profiler
Not concerning your question, but the code can be accelerated: * Omit the |clear d|, because it wastes time only. * Instead ...

9 years ago | 1

Answered
error message: unexpected record length
The row limit of 65535 is not the problem. Some Mac users explained in the past, that their |xlsread| failed, when the cells con...

9 years ago | 0

Answered
How to Generate 100 Random points inside the figure?
Create the 3 shapes at first: warning('off', 'MATLAB:alphaShape:DupPointsBasicWarnId'); Shape = cell(1, 3); % Top s...

9 years ago | 1

| accepted

Answered
Speed up my randperm code
|randperm(m,m)| is faster than |randpern(m)|. This reduces the runtime of the |Generate()| function by 20% already. You can f...

9 years ago | 1

| accepted

Load more