Answered
Error using VideoWriter to write video frames to a file
Maybe the debugger reveals some details. Type this in the command window: dbstop if caught error Then run the code again. If M...

5 years ago | 0

| accepted

Answered
Alternatives to using polyfit and polyval functions??
POLYFIT and POLYVAL are simple functions. If your teacher wants you to write them by your own, I assume, that this was a topic i...

5 years ago | 1

Answered
I'm taking errors
Please care for posting the compelete error message instead of mentioning only, that there is one. How do you start this functi...

5 years ago | 0

Answered
Why isn't my For Loop working?
Please post a copy of the complete message. This includes the line number. The posted code does not contain a problem which pro...

5 years ago | 0

Answered
'Too many input arguments' error when using imag()
imag accecpts 1 input onlky. I cannot guess, what "imag(ElevPointx,ElevPointy)" should do, therefore I cannot suggest a solution...

5 years ago | 0

Answered
Why adding a subfunction breaks an unrelated in-place function call?
You can check with format debug if the variable is copied or re-used. Does the pointer to the data change? I guess, that the ...

5 years ago | 0

Answered
hex2dec broken in R2020a?
hex2dec is much slower than sscanf(s, '%x'): value = pow2([96, 64, 32, 0]) * sscanf(str, '%8x') During the conversion to a dou...

5 years ago | 1

Answered
create a Moving Box Simulation in 1D
axes('Xlim', [-1, 12], 'YLim', [0, 3]); axis equal BoxH = myBox(0, []); dx = 0.1 for k = 1:100 pause(0.3); myBox(dx,...

5 years ago | 1

| accepted

Answered
how to remove fewdatapoints in a matrix?
Distance = Distance(18:end) or Distance(1:17) = [];

5 years ago | 0

| accepted

Answered
How to randomly extract 50 images from a file?
Dest = '/Users/Desktop/Image Dataset'; FileList = dir('/Users/Downloads/ILSVRC2012_img_val/*.jpg'); % DIR command was miss...

5 years ago | 0

| accepted

Answered
How to plot a structure with multiple fields
FigH = figure; AxesH = axes(FigH, 'NextPlot', 'add'); for k = 1:numel(rgn2) data = rgn2(k).PixelList; plot(data(:, 1...

5 years ago | 0

| accepted

Answered
How to read 2d data and create a 3D matrix?
B = reshape(A.', 1000, 110, 100); In general all such transformations can be done by: B = reshape(permute(reshape(A, [x,y,z]),...

5 years ago | 1

| accepted

Answered
How do you work on scripts from multiple computers?
I'm using a server to syncronize my files, comparable to Dropbox, but with a sufficient data protection. For offline machine I ...

5 years ago | 0

| accepted

Answered
How to ignore part of for loops for manual runs?
for i = 1:100 if condition nj = 10; else nj = 20; end for j = 1:nj ... end end Or mayb...

5 years ago | 0

| accepted

Answered
Combining matrices into one
T = (1:525600).'; B = [3849, 0.1833; ... % Different values to avoid confusion 3850, 0.1834; ... 3851, 0.1835; ....

5 years ago | 0

| accepted

Answered
How to generate a matrix/column of data?
a = [1, 2]; b = [11, 12]; MA = zeros(4, 3); k = 0; for i = 1 : length(a) for j = 1 : length(b) %v = 2*a(i) ...

5 years ago | 0

| accepted

Answered
Replace character in string/cell with the character above it
Maybe: a_new = a; a_new(2:2:end) = a(1:2:end); Or: index = repelemt(1:2:numel(a), 1, 2): a_new = a(index) [EDITED] after...

5 years ago | 0

Answered
add boldface text to text area
As far as I know the uitextarea is not powerful enought yet to allow setting different text properties. Neither the LaTeX syntax...

5 years ago | 0

| accepted

Answered
Exporting matrices from function to cell array
Using assignin suffers from the same problems as eval. See https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-v...

5 years ago | 0

Answered
While-loop in GUI ends when interacting with other GUI controls
I have an idea: function checkHideLegend_Callback(hObject, eventdata, handles) % When reaching this, the struct [handles] cont...

5 years ago | 1

Answered
integral of a .p file
q = integral(@gp,a,b) % ^ The command integral requires a function handle. Calling "gp" calls the function gp.p wit...

5 years ago | 0

Answered
Reduce Matrix size with interpolated data arrays
The mean over neighboring rows and columns is smarter than a linear interpolation, which just omits the intermediate rows and co...

5 years ago | 1

Answered
how i correct error in Matlab
The error message means, that either pop or pop(i).mat is not a struct, such that you cannot access a field using the dot. Chec...

5 years ago | 0

| accepted

Answered
Multiply (logical) array with cell
b = {'Hello'; 'Goodby'}; a = [1 0 ; 1 0; 0 1 ]; index = a * [1; 2] b(index)

5 years ago | 1

| accepted

Answered
How to store the data of specific loop values?
Did you read the Matlab Onramp already? result = zeros(1, 100); % Pre-allocation for k = 1:100 result(k) = rand; %...

5 years ago | 0

| accepted

Answered
how to write an opened file in a loop to a new file in a different folder using fwrite?
Yes, of course the first valid file identifier is 3. 1 is the standard output, 2 the channel for error messages. With opening t...

5 years ago | 0

| accepted

Answered
How do I use the values of the vector in the for loop
This is no valid syntax in Matlab: [. 1.2. 1.25 .35] I guess you mean: [0.1, 0.2, 0.1, 0.25, 0.35] You overwrite P inside the...

5 years ago | 0

Answered
How to stop matlab executing a command
Press Ctrl-C .

5 years ago | 0

| accepted

Answered
Index exceeds matrix dimensions.
Your code runs without problems: test_data_in = rand(1, 1000); check_data = test_data_in(1:600); for i = 1:600 check_dat...

5 years ago | 0

Answered
how save plot in specific folder ?
Add the wanted path to the file name: filename = fullfile('D:\Your\Folder', 'File.jpg') exportgraphics(obj, filename)

5 years ago | 1

| accepted

Load more