Answered
Assigning values to the arguments of a function handle
Again, using numbered variables as not considered good programming practise. I believe this correspoinds to your original cod...

2 years ago | 0

| accepted

Answered
I am using the symbolic tool box and have generated a number that has over 25,000 digits and would like to store that number in it's entirety onto a disk file.
One option would be to save it as a string array — syms x x = vpa(pi, 250) srt_x = string(x) whos You might want to s...

2 years ago | 0

| accepted

Answered
How do I convert double to cellstr?
Use the compose function (introduced in R2016b) — A = [2 25 1017]; Ac = compose('%d',A) .

2 years ago | 0

| accepted

Answered
Why do I get the error "Unrecognized function or variable"?
The important information is likely not shown here. My guess is that you are referring to ‘HW1’ somewhere else (perhaps in anot...

2 years ago | 0

Answered
Error with using fminsearch
Yoiu need to add the 'Vars' argument to your matlabFunction call— syms x y; % Peaks Funktion f = 3*(1-x)^2 * exp(-x^2-(y...

2 years ago | 1

Answered
Error using patch Value must be of numeric type and greater than 1.
I was not able to get these to work with patch (I still do not understand what that problem is), however with a minor modificat...

2 years ago | 0

| accepted

Answered
Moving from an index in the matrix to an x,y value
Perhaps something like this — x = linspace(0, 10, 50); y = linspace(0, 10, 50); zm = exp(-(x-4.5).^2/4) .* exp(-(y(:)-4.5).^...

2 years ago | 0

Answered
whos - I can't capture the output
Perhaps something like this — A = magic(7); B = string(randi(9, 4)); C = sin(2*pi*(0:0.01:1)); whos S = whos; Fields ...

2 years ago | 1

| accepted

Answered
Make a contourf plot beautifuller
The first one (with or without contour lines) is possible with a combination of the surf and view functions — [X,Y,Z] = peaks(...

2 years ago | 1

| accepted

Answered
Implementing Hilbert Function to obtain envelope
The envelope function was introduced in R2015b. It makes these problems easier.

2 years ago | 0

Answered
Extracting data from text file after a specified word
The textscan function works well for these sorts of problems if the files have a consistent internal structure — contents = fi...

2 years ago | 2

| accepted

Answered
Generate coordinates (3D), having the same contour as the initial circle but with a smaller size
One approach — nodes = importdata("plane_new_ok.mat"); center = importdata("node_new_ok.mat"); rf = scatteredInterpolant(n...

2 years ago | 0

| accepted

Answered
How can I add two fft functions?
It is obvious from looking at the code that the fft results have different lengths, specifically 523 and 1046 elements in each. ...

2 years ago | 1

Answered
Where is the month, day and year string stored in a plot with a datetime axis which shows hours and minutes in the xticklabel string?
If you have R2023b, you can use the recently introduced xsecondarylabel function — t1 = datetime('2023-04-01 04:00:00'); t2...

2 years ago | 0

| accepted

Answered
area in trapz coming out negative
‘... was wondering if I can just take the abolute value and if that would be bad data?’ If the descending values of the indep...

2 years ago | 1

Answered
Error using fopen for obj file
A returned value of -1 means that fopen can’t open the file. First, run: which fileIn to see if MATLAB can find it. If no...

2 years ago | 1

| accepted

Answered
Problem with fitting a loglog plot
Using a linear regression on logarithmically-transformed data creates multiplicative errors, not additive errors that least squa...

2 years ago | 0

Answered
How to use symbolic equation?
For symbolic plots, use the fplot function — syms Wosc R C gm Ao = gm*R/(1+2*pi*Wosc*R*C); pretty(Ao) R = 1000; C = 27...

2 years ago | 1

| accepted

Answered
Add a line on the graph
Try this — num_simulations = 10000; %Common parameters Discount_Rate_min = 0.06; % assume 6-8% Discount_Rate_max = 0....

2 years ago | 2

| accepted

Answered
Combination of two tables with different time lines
Converting the times in the first file is straightforward. Everything else seems to be NaN. T1 = readtable('Combining1.xlsx'...

2 years ago | 0

| accepted

Answered
How to solve the error for graph?
I tweaked your code a bit, however it is still incorrect. The main problem is that ‘avg_LCOH_SOEC’ should be a (24x24) matrix...

2 years ago | 0

Answered
Adding the stl file to the Matlab simulation
It depends what the .stl file is. The first step would be to use the stlread function to import it, and then use trisurf (or...

2 years ago | 0

Answered
How can I specify the region of the contour plot ?
Without the data or the contour levels labels, a precise reply is not possible. If you know that all the data are either greate...

2 years ago | 0

Answered
Getting NaN after filtfilt function
You are using transfer function (‘[b,a]’) output implementation. Often, this creates an unstable filter, producing NaN values i...

2 years ago | 0

| accepted

Answered
How to plot different datasets in a scatterplot next to each other at discrete points on x-axis?
See if the swarmchart function (introduced in R2020b) will do what you want.

2 years ago | 1

Answered
What code will open .stl files successfully?
I am having serious problems trying to access that file. (I’ll keep working on it.) The patch function requires ‘x’, ‘y’, (a...

2 years ago | 0

Answered
Can I assign vectors with different number of rows per-column to a matrix?
I would use a cell array. It is not as convenient to use as a numeric matrix, however it tolerates different length vectors.

2 years ago | 0

| accepted

Answered
I'm dealing with Speech compression using Linear Predictive Coding. When I run the code I get a few errors.
This is the path to the file, however it does not include the file name (and extension): kdt_003 = fullfile('C:\Users\user\Des...

2 years ago | 1

| accepted

Answered
mapping bode plot for Low Pass Filter
You need to do element-wise exponentiation (.^) and division (./) — R = 1000; C = 100*10^(-9); tau = R*C; w = 0:100:100000;...

2 years ago | 0

Answered
how to find the values that minimize the objective function using the generic algorithm?
I used some standardised code that I wrote for these sorts of problems that I adapted to your data — clear all close all clc...

2 years ago | 0

Load more