Answered
Image size reduction using scaling
This can be done efficiently by <https://www.mathworks.com/matlabcentral/fileexchange/24812-blockmean FEX: BlockMean>. You can r...

9 years ago | 0

| accepted

Answered
Error: Inner matrix dimensions must agree.
We have to guess what you want to achieve, because all we see is the failing code. If you mention the intention (preferrably in ...

9 years ago | 0

| accepted

Answered
How to display a number in the edit text box in GUI ?
Set a breakpoint in the line and use the debugger to examine, what's going on: set(handles.edit1,'String',num2str(th1)); ...

9 years ago | 0

Answered
How do I pass an object to a function
I do not understand the problem exactly. In Matlab the type of inputs cannot be defined in the function definition. Functions...

9 years ago | 0

Answered
MathWorks Fatal Exit Reporter
Did it work before? What has happens since it worked the last time? Did the user restart the computer already? Do not answer ...

9 years ago | 0

Answered
Will Matlab support AMD GPU in future?
Support with what? Accelerated OpenGL graphics or GPU processing? Because this forum is mainly supported by voluntary Matlab ...

9 years ago | 0

Answered
How can I save different variables in separated files using cellfun/arrayfun?
The |save| command expects the data as the name of the variable. It does not accept the array to be saved directly. If you reall...

9 years ago | 0

| accepted

Answered
How to fix this error 'Error using xor Matrix dimensions must agree'?
There are several |xor| commands in your code. The complete error message shows you, which command is failing. You could use the...

9 years ago | 0

Answered
Write a well commented and structured MATLAB function that will generate a square matrix of any size, n, with the following pattern (a 4x4 matrix is shown for example): 1 0 2 0, 0 3 0 4, 5 0 6 0, 0 7 0 8
Perhaps you can solve your homework together: <https://www.mathworks.com/matlabcentral/answers/336007-how-can-i-create-a-checker...

9 years ago | 0

| accepted

Answered
Why does using MATLAB's ODE result in undefined behavior for this simulation?
I fixed the codes of |model1| and |model2|: * |1.013*(10^5)| to |1.013e5|, because this is faster and more accurate * |opts ...

9 years ago | 1

| accepted

Answered
Removing NaN from matrix
Exactly: This cannot work, because all columns of a matrix must have the same number of rows. You cannot remove all NaNs and kee...

9 years ago | 5

| accepted

Answered
Matlab Strict Mode?
A "strict mode" would not even break old code, but even the idea behind Matlab to allow to users to perform matrix operations co...

9 years ago | 0

Answered
If logic not working inside for loop
Please use Matlab's tools for an automatic indentation. Then the different levels of the IF conditions get clear immediatly. ...

9 years ago | 0

| accepted

Answered
How create grid name in axes???
Matlab R2013a did not use the modern GUI handles ("HG2") and you cannot access the properties using the dot syntax: plot(ha...

9 years ago | 0

| accepted

Answered
how can i find row position for minimum value that changes every cycle. each cycle has 100 data points( 100*1 matrix).
X = rand(1, 6000); [minValue, minIndex] = min(reshape(X, 100, [])); Now the minIndex is related to each block. To get th...

9 years ago | 0

| accepted

Answered
Invalid syntax at 'x'. Possibly a ), }, ] is missing.
You cannot define a function with fixed inputs. The input arguments must be variables: function num = match(image1, image2)...

9 years ago | 1

Answered
Tic Toc seems disturb the operation of if-else function in the for-loop
No, |tic/toc| does not influence the |if| command. This is a magic idea and Matlab does not do such strange things. Otherwise yo...

9 years ago | 0

Answered
Return Vector of length zero ??
|Kpath| is called with the parameters defined by |p.WL = sld1 ;p.WR = sld2|. If |sld1| and |sld2| are empty matrices, |KPath| re...

9 years ago | 1

Answered
code to perform euler method not working properly
The shown behaviour occurres for h=0.01 and h=0.001 also. I assume, the formula in |projectedmatrix2| is wrong.

9 years ago | 0

| accepted

Answered
Find the lowest values in vector array.
Do you have the Signal Processing Toolbox? Then: [Minima, Index] = findpeaks(-simple2)

9 years ago | 1

| accepted

Answered
Matrix dimensions must agree
The problem looks strange, but Matlab does not do any magic things. Therefore there must be a deterministic reason for the error...

9 years ago | 1

Answered
How can I create a checkerboard matrix of alternating values?
If you have the matrix with alternating 0 and 1 values already, the step to the wanted result is small. Assuming that M is the 1...

9 years ago | 0

| accepted

Answered
Which functions require double precision
You can search for this string in the toolbox functions. I use the free <http://stefanstools.sourceforge.net/grepWin.html GrepWi...

9 years ago | 1

| accepted

Answered
How to choose the best threshold value to make decision if two images similare or not?
It depends on your problem. If you want to classify pictures of the moon and want to recognize young craters, or if you have ima...

9 years ago | 0

Answered
function not using all values
The order matters: injcut (v <= LCSPEED_MAX/3.6 & rpm > LCREV_MAX) = 0.75; % 75% torque allowed injcut (v <= LCSPEE...

9 years ago | 0

| accepted

Answered
adding apostrophe for reading a folder name
Check the name twice. Are there any unicode characters in the name? FileList = dir('E:\Data_Sets\Fault\Outer\6*'); Name ...

9 years ago | 0

Answered
Turning off GUI Alerts
You cannot include a command to prevent getting the figure on top, but you can remove the command, which causes this behaviour. ...

9 years ago | 0

| accepted

Answered
How to convert this vectorized code into GPU code for MAXIMUM speedup ?
The bottlenecks of the code are the darn |clear all| and the disk access using |imwrite|. Moving this to the GPU will not help.

9 years ago | 0

Answered
Is fullfile(0,0) undocumented behavior or bug?
This is a bug. |fullfile| should contain a test, if all inputs are strings or character vectors. This happens for 1 input direct...

9 years ago | 0

| accepted

Answered
Help with modifying built-in ode45
Limiting the trajectory to certain values does not happen inside the integrator. You do not have to modify |ode45.m|, but the fu...

9 years ago | 1

Load more