Respondida
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...

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 1

Respondida
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...

casi 3 años hace | 0

| aceptada

Respondida
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).^...

casi 3 años hace | 0

Respondida
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 ...

casi 3 años hace | 1

| aceptada

Respondida
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(...

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 2

| aceptada

Respondida
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...

casi 3 años hace | 0

| aceptada

Respondida
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. ...

casi 3 años hace | 1

Respondida
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...

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 1

Respondida
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...

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 1

| aceptada

Respondida
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....

casi 3 años hace | 2

| aceptada

Respondida
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'...

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 0

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

casi 3 años hace | 0

| aceptada

Respondida
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.

casi 3 años hace | 1

Respondida
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...

casi 3 años hace | 0

Respondida
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.

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 1

| aceptada

Respondida
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;...

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 0

Cargar más