Answered
Subtraction of 2 matrices of the same dimensions and values, gives large floating point values instead of 0!
Welcome to the world of floating point calculation. Computers store values in binary, which sometimes requires rounding. This ro...

7 years ago | 1

| accepted

Answered
How to find the local mean of an image?
The fastest way to get a local average is to do a convolution with a flat structuring element: %load example image A=imread(['...

7 years ago | 0

| accepted

Answered
How to calculate the shortest distance between points and a line?
You can use the point_to_line_distance function.

7 years ago | 0

| accepted

Answered
Can isstrprop search for 2 properties?
I would convert to double type and use ismember to check if all characters are allowed. Alternatively you could just convert ...

7 years ago | 1

Answered
EULER'S METHOD GUI HELP
You are using str2num (which you shouldn't), and you are setting a numeric vector as the string property. You may need to consid...

7 years ago | 1

Answered
How do i create checkboxes near each plots in a subplot window ?
You can use uicontrol('Style','checkbox').

7 years ago | 0

| accepted

Answered
Matching based on working days
You can use the weekday function. You can easily adapt the function below to apply specific shifts. A=datenum({'2019-04-07','20...

7 years ago | 0

| accepted

Answered
Two differente program to write in the same place
This is just a simple concatenation: function output=xx output=[main transfer]; end function output=main output=rand(19,6);...

7 years ago | 0

| accepted

Answered
help with this 02 questions please
For question 1: link For question 2: you can create a CloseRequestFcn that also closes the secondary app link.

7 years ago | 0

| accepted

Answered
Memory issue to create 4D array
The amount of data is probably huge, is not pre-allocated and will probably not fit in memory. Have you calculated an estimated ...

7 years ago | 0

Answered
Finding pythagoras triples when only c is known
You are quite close. The code below contains some optimization in terms of selection of values to check, and the check is modifi...

7 years ago | 1

Answered
how do i read a folder database into matlab
Use uigetdir to ask the user for a folder, then use dir to get the list of files inside that folder, then use a for loop to load...

7 years ago | 0

| accepted

Answered
if statement not working
What you probably think should happen is in the code below, however, there is a better way. A = [5;5;5;3;3;2]; B = [10;4;10;10...

7 years ago | 1

| accepted

Answered
How can I change from Cell to Double and writing in many lines
The code below should do what you want. %generate input A=cellfun(@(x) {x+rand(6,6)},num2cell(1:19)'); %convert the cell co...

7 years ago | 0

| accepted

Answered
Round to Nearest Multiple of 4.
a=45; k=4; b=k*round(a/k);

7 years ago | 6

| accepted

Answered
sequential file reading and operations
That is not how the textscan function works. You should read the documentation for the functions you are using. figure(1) root...

7 years ago | 0

| accepted

Answered
code with the same function
There are two easy options: a loop and a histogram: %for loop method: data = fileread('mytextfile.txt'); letters='ABCDEFGHIJK...

7 years ago | 1

Answered
Test poker hand by using edit text boxes GUI
What I would do is first of all change your value convention to something more standard (Ace=1,Jack=11,Queen=12,King=13) or keep...

7 years ago | 0

| accepted

Answered
Game of GUI matrix dimensions must agree
Because a char array is an array of values in Matlab, you are trying to compare an array of values to another array. If what you...

7 years ago | 0

| accepted

Answered
Change function name everywhere
If you change the name in the function declaration, the auto-change should work, just as with variable names inside the same sco...

7 years ago | 3

Answered
How to Create Multidimensional table in for loop
A bold guess based on your commented code: Trajectory =1:15; TrajDetail = zeros(1,4,15); for i = 1:length(Trajectory) TS...

7 years ago | 0

| accepted

Answered
could anyone hep me to clear my doubt
Because inf is the extreme, you can use it to find the next value in your data. As an example, the code below finds the maximum ...

7 years ago | 0

Answered
How do I add data to multiple figure windows in one loop?
Use explicit handles: fig4=figure(4); fig5=figure(5); %'NextPlot','add' is equivalent to hold('on') ax4=axes('Parent',fig4,'...

7 years ago | 0

| accepted

Answered
How to unit (combine) logical array "along" it's 3rd dimension or How to find logical OR betwen all pages along 3rd dim of 3D array
As Guillaume mentions, you should be using this: any(L,3) instead of my original answer sum(L,3)>0 (Even if the result shoul...

7 years ago | 0

| accepted

Answered
How to avoid evalin?
You can solve it this time by loading into a struct: S=load('GivenFile.mat'); fn=fieldnames(S); for n=1:numel(fn) tempVa...

7 years ago | 0

| accepted

Answered
App Designer button callback
You can force a graphics update with drawnow, or by introducing a small pause (in general I see people using pause(0.01) or a si...

7 years ago | 0

| accepted

Answered
How to fast process a calculation within a matrix without using a loop?
Yes, use the power of array processing in Matlab: B=10.^-A;

7 years ago | 0

| accepted

Answered
How can i know what is the n when the nth is the smallest or biggest
If you mean the index of the minimum value, the documentation for the min function shows you how to find the index. A different ...

7 years ago | 0

| accepted

Answered
Entering default values in a function.
If you only want to specify n, you should only provide that as the input: n=4; [counter,ratio,x,TOL,ROC]=FixedPointIteration(n...

7 years ago | 0

Answered
Input data using GUI
Have a look at the code below, read the documentation for every function that you don't know and try to understand the flow of t...

7 years ago | 1

| accepted

Load more