Answered
Sensible difference between computation on GPU single type variable and CPU single type
This is the expected behavior. The matrix multiplication is affected by the rounding error of the dot products of the rows and c...

8 years ago | 0

Answered
Pause script, edit figure and linked data using brush tool, then continue with script
Do not use scripts, but divide the work into two functions. Call one function at first. When it is finished, modify the data. Th...

8 years ago | 0

Answered
how to efficiently encode two values as a unique entitiy
Start with a simplification by omitting repeated comparisons: A = 3; B = 3; C = []; if A == 1 if B == 1 C = 1; ...

8 years ago | 0

Answered
how to solve this problem?
The error message is clear: Matlab does not find a function called glcm . This function does not belong to Matlab's toolboxes so...

8 years ago | 0

Answered
rotation meshgrid surface with the predefined angel(using rotation matrix)
A 2D rotation is sufficient, if you want to rotate the X and Y coordinates only. x = 1:0.2:1.8; % [1 1.2 1.4 1.6 1.8]; y = ...

8 years ago | 5

Answered
How can i update data in the figure window in MATLAB GUI using pushbutton callback?
Instead of hold on prefer to create the axes with the wanted "accumulation" flag directly: axes('NextPlot', 'add') Now new li...

8 years ago | 0

| accepted

Answered
passing data & connecting gui(s)
A specific question is more efficient than "I don't understand how it works". The code example contains useful comments already....

8 years ago | 1

| accepted

Answered
Problem with for loop
In for j=1:nx you run a loop over the rows, not columns. Do you mean ny here? [nx, ny] = size(A); idx_start = NaN(1, nx); % ...

8 years ago | 1

Answered
How can we detect the moment the signal goes lower than zero, back at zero, higher than zero and back at zero again?
Marking one example is not sufficient to create a mathematical function for a reliable detection of the phases. You will find a ...

8 years ago | 0

Answered
How do I obtain install key and license key for my offline machine?
Simply search in this forum to find: https://www.mathworks.com/matlabcentral/answers/105854-how-can-i-install-matlab-or-other-ma...

8 years ago | 0

Answered
How do I create two push buttons to change the visibility of an image?
Did you display your image already anywhere? Did you store its handle? function displayImage_Callback(hObject, EventData, handl...

8 years ago | 0

| accepted

Answered
Matlab GUI show/hide data on same plot
I guess, that you forgot to share the handles between the callbacks. function checkbox_bfafhp_Callback(hObject, eventdata, hand...

8 years ago | 1

| accepted

Answered
How to plot h_a(t) = (a + cos(t), -2a^2 + sin(t))
axes('NextPlot', 'add'); t = linspace(-2*pi, 2*pi, 1000); % E.g. for k = 0:40 a = -2 + k / 10; plot(a + cos(t), -2 ...

8 years ago | 1

Answered
How can i download matlab faster?
Please ask the technical support using the "Contact Us" link on top of this page. The public forum cannot have knowledge about t...

8 years ago | 0

Answered
How to speed up matrix update zeros by using previous value?
Start with: c = fillmissing(c, 'previous', 'EndValues', 'nearest'); Another idea is to process the matrix column-wise: c = [0...

8 years ago | 1

| accepted

Answered
List all and only files with no extension
Folder = 'C:\Temp'; % Your folder FileList = dir(fullfile(Folder, '*')); NameList = {FileList.name}; % NameList(ismember(N...

8 years ago | 2

| accepted

Answered
iterate over a vector in a for loop
Avoid length, but use size with a specified dimension. for f = 1:size(bandwidths, 2) for l = 1:size(priors, 1) bw = ban...

8 years ago | 0

Answered
Remove the slprj folder programmatically
This does not solve the problem, but helps to identify the problem: Catch the error message: [status, msg] = rmdir('slprj') if...

8 years ago | 0

Answered
Compressing file into zip file
This is easy with the GUI of e.g. 7zip. But do you want to do this inside Matlab? Then what exactly is the problem? zip('first....

8 years ago | 0

Answered
Index in position 1 exceeds array bounds (must not exceed 1)
The message: "Index in position 1 exceeds array bounds (must not exceed 1)" seems to be very clear: The first index of an arra...

8 years ago | 6

Answered
Finding maximum integer between [100,200] divisible by 21?
Hints: The vector of number from 100 to 200: 100:200 Dividable by 21: mod(x, 21) == 0 The maximum value can be found by the...

8 years ago | 0

Answered
How to simultaneously bold and italic the label of matlab? Especially for label interpreted by latex.
If you mean the X-lable of an axes, this works in the current version: xlabel('\it{\bf{bold+cursive}} \it{Only cursive}') or ...

8 years ago | 1

Answered
Positioning of the slider by just a single click
This is not the standard behavior of sliders and as usual, implementing an unexpected behavior of a GUI element will confuse the...

8 years ago | 0

Answered
Use previous calculated value in ODE as guess in current timestep
Maybe storing the pressure of the previous call of the function is sufficient already. Then use a persistent variable: function...

8 years ago | 3

| accepted

Answered
How to read the audio information of a file directly from internet?
The error message is clear: webread replies the data delevered from the internet. Therefore the name of the variable "filename" ...

8 years ago | 1

| accepted

Answered
collision code in Matlab
You know how to check the distance betwee the walls of the box and the center of the objects already. Now you need only to check...

8 years ago | 2

Answered
extracting row and column from a cell which contains numbers and strings
errorvals = cell2mat(mymatrix(:, 11)) [~, minIndex] = min(errorvals); result = mymatrix(minIndex, 1:10); Do you h...

8 years ago | 0

Answered
How to mask a circle in perspective projection?
I assume the triangles are the "dots" and they are read, because they are inside a certain distance to the line through the cent...

8 years ago | 0

Answered
Diagonal Line in fill plot?
I guess you mean the diagonal from (0,0) to (21,21). Change the fill command to: % Was: fill(RoadVerts(1:1,:),RoadVerts(1:2,:),...

8 years ago | 0

| accepted

Answered
Binary data dealing with fread
I cannot confirm this. a = uint8(sscanf('F9BDFFFF', '%2X')); fid = fopen('test.bin', 'w'); fwrite(fid, a, 'uint8'); fclose(f...

8 years ago | 0

| accepted

Load more