Answered
How to make the linear function
In order for it to be a linear function as you asked for, then you should take a list of all of the (x, y) coordinates that you ...

3 years ago | 1

| accepted

Answered
code not working in MATLAB 2020b
You appear to be using an older version of MATLAB. Use downloadFolder = matlab.internal.examples.downloadSupportFile('audio','S...

3 years ago | 0

| accepted

Answered
How to store output from for loop to a table
v = 100; g = -10; counter = -1; loops = 19; Those are all scalars. m = zeros(20,2) m is a column vector. t = counter;...

3 years ago | 0

Answered
error when using plot
the data all have a 2065x1 That implies that aapl = load('aapl.txt'); aapl is size 2065 x 1. x = [1 2 3 4 5 6 7 8 9 10]; x ...

3 years ago | 0

| accepted

Answered
How to extract data out of a text file from specific point in a string
fid = readlines('input.txt'); A = rmmissing(double(regexp(fid,'[+-]?\d+(\.\d*)?', 'once', 'match'))); Note: this particular ve...

3 years ago | 0

| accepted

Answered
Plotting the element of a 3D array
plot(T, squeeze(F(1,1,:)))

3 years ago | 0

| accepted

Answered
How to create zip nested folder in a single folder parent folder
https://www.mathworks.com/help/matlab/ref/zip.html use the three parameter version of zip. Pass '.' as the second parameter a...

3 years ago | 0

| accepted

Answered
Reading values from the CSV files using textscan command
I recommend that you readtable() with 'Delimiter', '\t' or 'Delimiter', char(9) if it does not recognize '\t' But otherwise, i...

3 years ago | 0

Answered
I want the following code to loop through multiple folders instead of having to open each folder individually so that I can do batch file processing.
directory = uigetdir('*',"Select Folder With Files To Be Processed"); You could change that to parentdirectory = uigetdir('*',...

3 years ago | 0

| accepted

Answered
Help with the fscanf function
Call fscanf() with size parameter [2, inf] and use .' to transpose the output to N x 2 S = ... "4 6" + newline + ... ...

3 years ago | 0

| accepted

Answered
fitgeotrans projective not giving me the right answer
The transformation code is normalizing z. format long g sourcePoints = [ [1239.98, 199.76]; [199.984, 199.76]; [199.984, ...

3 years ago | 1

| accepted

Answered
How can I encode a message into an image using Huffmanenco?
[dict,avglen] = huffmandict(symbol,probability) Up to there looks acceptable. A bit inefficient in places, but work-able. imag...

3 years ago | 0

Answered
Process large image by patch
See blockproc . If you want to do sliding block processing, use the BorderSize option. If the size of the data being returned...

3 years ago | 0

Answered
Syntax error which I cannot find ( find the minimum of a function using Quadratic Approximation Method )
p = ( f1*(x2.^2-x3.^2) + f2*(x3.^2-x1.^2) + f3*(x1.^2x2.^2) ) / (2*(f1*(x2-x3)+f2*(x3-x1)+f3*(x1-x2))); ...

3 years ago | 0

| accepted

Answered
Does Matlab have a trajectory generator function for 3D movement?
Those functions are for 2D work. As those functions are designed for generating coefficients for a polynomial, they are designe...

3 years ago | 0

Answered
Use Parfoor Loop for Parameter Sweep Optimization
List concatenation is one of the permitted reduction strategies, so you can assume that it will handle memory allocation appropr...

3 years ago | 0

Answered
AppDesigner does not overwrite mlapp on Linux; works fine on Windows
The problem appears to be due to a regression in the Linux kernel. More details are available at https://www.mathworks.com/matla...

3 years ago | 0

| accepted

Answered
I want to count (tally) the number of occurrences of any generated integer over a 156 for-loop.
integers appearing "together" is not clear. Since your generation is an ordered vector, does that mean that the integers must be...

3 years ago | 0

Answered
Plotting Summation Function in matlab
t = 0:1000; t is a row vector n = 0:250; % Number of summations n is a row vector that is a different size than t. sum_parts...

3 years ago | 0

| accepted

Answered
How to find specific elements in a matrix
This kind of task is usually easier to write with nested for loops over size() of the array. If you are required to use a single...

4 years ago | 0

Answered
Converting symfun to function handle
If you want to "demote" a and b from functions to variables then you can subs() variables into the expression. If you want ha...

4 years ago | 0

Answered
Matlab equivalent of Maple's remove_RootOf
Use children() Maybe arrayfun @(X)children(X, 1)

4 years ago | 1

| accepted

Answered
Loop plotting for individual years
g = findgroups(ymd(T1.DateTime)); Now you can splitapply() some plotting code on elements of your table using groupping vari...

4 years ago | 0

Answered
Read a text file that includes numbers and strings and edit it in different places
readlines() to get a string array. Index 1:66, then several entries with the new lines, then index 68:end. writelines() the resu...

4 years ago | 0

Answered
How do i create a new .txt document for each run of a code?
fprintf() can never create files, only write to files that are already opened. fopen() with 'w' permission will create a file...

4 years ago | 1

Answered
How do you recognize an empty line?
Check isempty(strtrim(LINE))

4 years ago | 0

Answered
How to generate data?
V = 10660:1:11700; deltavB = 50:1:70; VB = 1:1:81 numV = length(V); numdeltavB = length(deltavB); numVB = length(VB); ...

4 years ago | 0

Answered
license activation failed on remote linux server
xhost +SI:localuser:root sh activate_matlab.sh

4 years ago | 0

Answered
Need to update the cost function for each column but is only updating for the last column
v = 5*rand(200,1); Okay, looks fine in itself. v(:,:) = v(i)+(F.*cos(theta(i))-u.*fn)./m*dt; You extract one single eleme...

4 years ago | 0

Answered
How can I avoid calling a large dataset in every iteration of fmincon Optimization?
See http://www.mathworks.com/help/matlab/math/parameterizing-functions.html for the case where you can define a variable once ou...

4 years ago | 1

| accepted

Load more