Tag Archives: matlab
How can I create a surface plot from ROIs (9) in an image?
I need to input an image, create 9 equal ROIs, and output a surface plot of pixel x pixel to show the 9 ROIsI need to input an image, create 9 equal ROIs, and output a surface plot of pixel x pixel to show the 9 ROIs I need to input an image, create 9 equal ROIs, and output a surface plot of pixel x pixel to show the 9 ROIs roi, surface plot, pixel dimensions MATLAB Answers — New Questions
how to clean the content inside the folder
hi, i want clean the folder, as follwing shows, which command i can use.hi, i want clean the folder, as follwing shows, which command i can use. hi, i want clean the folder, as follwing shows, which command i can use. clean folder MATLAB Answers — New Questions
The extrinsic function ‘perms’ is not available for standalone code generation.
I am trying generate mex file using matlab coder, where in my function i use function perms, but I get this problem
The extrinsic function ‘perms’ is not available for standalone code generation. It must be eliminated for stand-alone code to be generated. It could not be eliminated because its outputs appear to influence the calling function. Fix this error by not using ‘perms’ or by ensuring that its outputs are unused.
I already using coder.extrinsic(‘perms’); but the problem still appear.
Anyone knows how to solve this, or Is there other function that I can use to replace perms?I am trying generate mex file using matlab coder, where in my function i use function perms, but I get this problem
The extrinsic function ‘perms’ is not available for standalone code generation. It must be eliminated for stand-alone code to be generated. It could not be eliminated because its outputs appear to influence the calling function. Fix this error by not using ‘perms’ or by ensuring that its outputs are unused.
I already using coder.extrinsic(‘perms’); but the problem still appear.
Anyone knows how to solve this, or Is there other function that I can use to replace perms? I am trying generate mex file using matlab coder, where in my function i use function perms, but I get this problem
The extrinsic function ‘perms’ is not available for standalone code generation. It must be eliminated for stand-alone code to be generated. It could not be eliminated because its outputs appear to influence the calling function. Fix this error by not using ‘perms’ or by ensuring that its outputs are unused.
I already using coder.extrinsic(‘perms’); but the problem still appear.
Anyone knows how to solve this, or Is there other function that I can use to replace perms? perms, matlab coder, mex file MATLAB Answers — New Questions
How do you set the Layout Option at construction for ui objects?
If I have a simple uifigure like:
fh = uifigure;
gl = uigridlayout(fh);
I can add a uicomponent (and specify where on the gridlayout it will sit) like:
btn = uibutton(gl, Text="Hello World");
btn.Layout.Row = 2;
btn.Layout.Column = 2;
Is it possible to set the layout options using the Layout property of the btn e.g.
btn = uibutton(gl, Text="Hello World", Layout=???);
Sending a struct like:
btn = uibutton(gl, Text="Hello World", Layout=struct(‘Row’,2,’Column’,2);
Gives the error:
Error setting property ‘Layout’ of class ‘Button’:
‘Layout’ value must be specified as a
matlab.ui.layout.LayoutOptions object.
But I can’t seem to instantiate an instance of the class LayoutOptions as:
l = LayoutOption();
Gives the error:
Unrecognized function or variable ‘LayoutOption’.If I have a simple uifigure like:
fh = uifigure;
gl = uigridlayout(fh);
I can add a uicomponent (and specify where on the gridlayout it will sit) like:
btn = uibutton(gl, Text="Hello World");
btn.Layout.Row = 2;
btn.Layout.Column = 2;
Is it possible to set the layout options using the Layout property of the btn e.g.
btn = uibutton(gl, Text="Hello World", Layout=???);
Sending a struct like:
btn = uibutton(gl, Text="Hello World", Layout=struct(‘Row’,2,’Column’,2);
Gives the error:
Error setting property ‘Layout’ of class ‘Button’:
‘Layout’ value must be specified as a
matlab.ui.layout.LayoutOptions object.
But I can’t seem to instantiate an instance of the class LayoutOptions as:
l = LayoutOption();
Gives the error:
Unrecognized function or variable ‘LayoutOption’. If I have a simple uifigure like:
fh = uifigure;
gl = uigridlayout(fh);
I can add a uicomponent (and specify where on the gridlayout it will sit) like:
btn = uibutton(gl, Text="Hello World");
btn.Layout.Row = 2;
btn.Layout.Column = 2;
Is it possible to set the layout options using the Layout property of the btn e.g.
btn = uibutton(gl, Text="Hello World", Layout=???);
Sending a struct like:
btn = uibutton(gl, Text="Hello World", Layout=struct(‘Row’,2,’Column’,2);
Gives the error:
Error setting property ‘Layout’ of class ‘Button’:
‘Layout’ value must be specified as a
matlab.ui.layout.LayoutOptions object.
But I can’t seem to instantiate an instance of the class LayoutOptions as:
l = LayoutOption();
Gives the error:
Unrecognized function or variable ‘LayoutOption’. uifigure, uigridlayout MATLAB Answers — New Questions
how to use printf inside a CUDA kernel?
Hi,
I wonder why I cannot use printf in cuda kernels. The code inside my file test.cu (adapted from the Mathworks help)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
__global__ void add2( double * v1, const double * v2)
{
int idx = threadIdx.x;
v1[idx] += v2[idx];
printf("identity: %d n",idx);
}
compiles nicely with mexcuda with
mexcuda -ptx test.cu
but trying to runt it from the command line as
k = parallel.gpu.CUDAKernel("test.ptx","test.cu");
N = 8;
k.ThreadBlockSize = N;
in1 = ones(N,1,"gpuArray");
in2 = ones(N,1,"gpuArray");
result = feval(k,in1,in2);
gather(result);
does not put any result on screen.
this link suggests some operations with the header, as #undef printf to avoid conflicts with mex.h… but it didn’t work for me.Hi,
I wonder why I cannot use printf in cuda kernels. The code inside my file test.cu (adapted from the Mathworks help)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
__global__ void add2( double * v1, const double * v2)
{
int idx = threadIdx.x;
v1[idx] += v2[idx];
printf("identity: %d n",idx);
}
compiles nicely with mexcuda with
mexcuda -ptx test.cu
but trying to runt it from the command line as
k = parallel.gpu.CUDAKernel("test.ptx","test.cu");
N = 8;
k.ThreadBlockSize = N;
in1 = ones(N,1,"gpuArray");
in2 = ones(N,1,"gpuArray");
result = feval(k,in1,in2);
gather(result);
does not put any result on screen.
this link suggests some operations with the header, as #undef printf to avoid conflicts with mex.h… but it didn’t work for me. Hi,
I wonder why I cannot use printf in cuda kernels. The code inside my file test.cu (adapted from the Mathworks help)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
__global__ void add2( double * v1, const double * v2)
{
int idx = threadIdx.x;
v1[idx] += v2[idx];
printf("identity: %d n",idx);
}
compiles nicely with mexcuda with
mexcuda -ptx test.cu
but trying to runt it from the command line as
k = parallel.gpu.CUDAKernel("test.ptx","test.cu");
N = 8;
k.ThreadBlockSize = N;
in1 = ones(N,1,"gpuArray");
in2 = ones(N,1,"gpuArray");
result = feval(k,in1,in2);
gather(result);
does not put any result on screen.
this link suggests some operations with the header, as #undef printf to avoid conflicts with mex.h… but it didn’t work for me. kernel, parallel.gpu.cudakernel MATLAB Answers — New Questions
Discrete integrator again fails to convert to Verilog due to delay balancing failure
I’m trying to convert a discrete integrator block to Verilog and I’m getting the following error. I’m new to FPGA and don’t yet understand the numerous settings very well, but I’d like to figure out what’s going on. I managed to set discrete time everywhere, but I haven’t figured out this error yet. Please tell me.I’m trying to convert a discrete integrator block to Verilog and I’m getting the following error. I’m new to FPGA and don’t yet understand the numerous settings very well, but I’d like to figure out what’s going on. I managed to set discrete time everywhere, but I haven’t figured out this error yet. Please tell me. I’m trying to convert a discrete integrator block to Verilog and I’m getting the following error. I’m new to FPGA and don’t yet understand the numerous settings very well, but I’d like to figure out what’s going on. I managed to set discrete time everywhere, but I haven’t figured out this error yet. Please tell me. hdl, verilog, fpga, hdl coder, simulink, numerical integration MATLAB Answers — New Questions
How to create an svn (1.9) repository to use with the file:/// protocol?
When I use the right click (current folder area) -> source control -> manage files… -> leading to the "Manage files using source control" dialog box, there is no way for me to create a new repository when using the SVN (1.9) Source control integration. How can I create a repository to be uses only be me locally with the file:/// protocol?When I use the right click (current folder area) -> source control -> manage files… -> leading to the "Manage files using source control" dialog box, there is no way for me to create a new repository when using the SVN (1.9) Source control integration. How can I create a repository to be uses only be me locally with the file:/// protocol? When I use the right click (current folder area) -> source control -> manage files… -> leading to the "Manage files using source control" dialog box, there is no way for me to create a new repository when using the SVN (1.9) Source control integration. How can I create a repository to be uses only be me locally with the file:/// protocol? svn, repository, source control, subversion MATLAB Answers — New Questions
Extracting data from a web page
Hi, I would like to automatize the extraction of data from different events and I would like some help on how extract the numerical data from this webpage: M 7.2 – 8 km W of Atiquipa, Peru (usgs.gov) like these:
W-phase Moment Tensor (Mww)
Moment:6.955e+19 N-m
Magnitude:7.16 Mww
Depth:17.5 km
Percent DC:96%
Half Duration:8.50 s
Catalog:US
Data Source:US 3
Contributor:US 3
Nodal Planes
NP1
Strike:309°
Dip: 16°
Rake: 57°
NP2
Strike: 164°
Dip:77°
Rake:99°
Principal AxesAxisValuePlungeAzimuthT6.893e+1957°86°N0.123e+199°342°P-7.016e+1931°246°
Principal Axes
T:6.893e+19,57°,86°
N:0.123e+19,9°,342°
P:-7.016e+19,31°,246°
I would appreciate the helpHi, I would like to automatize the extraction of data from different events and I would like some help on how extract the numerical data from this webpage: M 7.2 – 8 km W of Atiquipa, Peru (usgs.gov) like these:
W-phase Moment Tensor (Mww)
Moment:6.955e+19 N-m
Magnitude:7.16 Mww
Depth:17.5 km
Percent DC:96%
Half Duration:8.50 s
Catalog:US
Data Source:US 3
Contributor:US 3
Nodal Planes
NP1
Strike:309°
Dip: 16°
Rake: 57°
NP2
Strike: 164°
Dip:77°
Rake:99°
Principal AxesAxisValuePlungeAzimuthT6.893e+1957°86°N0.123e+199°342°P-7.016e+1931°246°
Principal Axes
T:6.893e+19,57°,86°
N:0.123e+19,9°,342°
P:-7.016e+19,31°,246°
I would appreciate the help Hi, I would like to automatize the extraction of data from different events and I would like some help on how extract the numerical data from this webpage: M 7.2 – 8 km W of Atiquipa, Peru (usgs.gov) like these:
W-phase Moment Tensor (Mww)
Moment:6.955e+19 N-m
Magnitude:7.16 Mww
Depth:17.5 km
Percent DC:96%
Half Duration:8.50 s
Catalog:US
Data Source:US 3
Contributor:US 3
Nodal Planes
NP1
Strike:309°
Dip: 16°
Rake: 57°
NP2
Strike: 164°
Dip:77°
Rake:99°
Principal AxesAxisValuePlungeAzimuthT6.893e+1957°86°N0.123e+199°342°P-7.016e+1931°246°
Principal Axes
T:6.893e+19,57°,86°
N:0.123e+19,9°,342°
P:-7.016e+19,31°,246°
I would appreciate the help extract data from webpage MATLAB Answers — New Questions
Adiabatic operation slope-loss algorithm (AO-SLA), how to do it: adiabatic coupling
I would like to write a code that can implement the equations of this paper: Adiabatic operation slope-loss algorithm for ultrashort and broadband waveguide taper
I tried it in python but it did not improve my coupling efficiency at all, mayba I am doing something wrong… Here it is my python code:
import sys
sys.path.append(r"C:Program FilesLumericalv241apipython")
import lumapi
import numpy as np
def create_adiabatic_taper(fdtd, width_input, width_output, alpha, lambda_0, n_eff):
# Define the number of segments to approximate the adiabatic taper
num_segments = 100
L_i_segments = np.zeros(num_segments)
# Widths for each section
widths = np.linspace(width_input, width_output, num_segments + 1)
vertices_x = []
vertices_y = []
for i in range(num_segments):
W1 = widths[i]
W2 = widths[i + 1]
W0 = (W1 + W2) / 2
epsilon = 1e-10 # Small value to prevent division by zero or very small numbers
theta = alpha * lambda_0 / (2 * (W0 + epsilon) * n_eff)
# Prevent theta from becoming too small
if np.abs(theta) < 1e-10:
theta = np.sign(theta) * 1e-10
L_i = (W1 – W2) / (2 * np.tan(theta))
# Ensure L_i is not negative
if L_i < 0:
L_i = 0
L_i_segments[i] = L_i
if i == 0:
vertices_x.append(0)
vertices_y.append(W1 / 2) # For half width
vertices_x.append(sum(L_i_segments[:i+1]))
vertices_y.append(W2 / 2) # For half width
vertices_x = np.array(vertices_x)
vertices_y = np.array(vertices_y)
vertices_x_full = np.concatenate([vertices_x, vertices_x[::-1]])
vertices_y_full = np.concatenate([vertices_y, -vertices_y[::-1]])
vertices = np.vstack((vertices_x_full, vertices_y_full)).T
print("L_i_segments:", L_i_segments)
print("Vertices X:", vertices_x_full)
print("Vertices Y:", vertices_y_full)
# Create the polygon
fdtd.addpoly(
x=0, # Center of the polygon in the x-direction
y=0, # Center of the polygon in the y-direction
z=0, # Center of the polygon in the z-direction
vertices=vertices, # Vertices of the polygon
material="Si (Silicon) – Palik",
name="adiabatic_taper_polygon"
)
fdtd.addtogroup("::model::Taper")
fdtd = lumapi.FDTD()
fdtd.selectall()
fdtd.delete()
# Parameters for the adiabatic taper
wavelength = 1550e-9 # Operating wavelength in meters
width_input = 0.5e-6 # Width of the input waveguide in meters
width_output = 0.075e-6 # Width of the output waveguide in meters
alpha = 1 # Slope angle in degrees
lambda_0 = 1550e-9 # Center wavelength in meters
n_eff = 3.47 # Effective index of the cross-section at the center of the taper
# Create the adiabatic taper
create_adiabatic_taper(fdtd, width_input, width_output, alpha, lambda_0, n_eff)I would like to write a code that can implement the equations of this paper: Adiabatic operation slope-loss algorithm for ultrashort and broadband waveguide taper
I tried it in python but it did not improve my coupling efficiency at all, mayba I am doing something wrong… Here it is my python code:
import sys
sys.path.append(r"C:Program FilesLumericalv241apipython")
import lumapi
import numpy as np
def create_adiabatic_taper(fdtd, width_input, width_output, alpha, lambda_0, n_eff):
# Define the number of segments to approximate the adiabatic taper
num_segments = 100
L_i_segments = np.zeros(num_segments)
# Widths for each section
widths = np.linspace(width_input, width_output, num_segments + 1)
vertices_x = []
vertices_y = []
for i in range(num_segments):
W1 = widths[i]
W2 = widths[i + 1]
W0 = (W1 + W2) / 2
epsilon = 1e-10 # Small value to prevent division by zero or very small numbers
theta = alpha * lambda_0 / (2 * (W0 + epsilon) * n_eff)
# Prevent theta from becoming too small
if np.abs(theta) < 1e-10:
theta = np.sign(theta) * 1e-10
L_i = (W1 – W2) / (2 * np.tan(theta))
# Ensure L_i is not negative
if L_i < 0:
L_i = 0
L_i_segments[i] = L_i
if i == 0:
vertices_x.append(0)
vertices_y.append(W1 / 2) # For half width
vertices_x.append(sum(L_i_segments[:i+1]))
vertices_y.append(W2 / 2) # For half width
vertices_x = np.array(vertices_x)
vertices_y = np.array(vertices_y)
vertices_x_full = np.concatenate([vertices_x, vertices_x[::-1]])
vertices_y_full = np.concatenate([vertices_y, -vertices_y[::-1]])
vertices = np.vstack((vertices_x_full, vertices_y_full)).T
print("L_i_segments:", L_i_segments)
print("Vertices X:", vertices_x_full)
print("Vertices Y:", vertices_y_full)
# Create the polygon
fdtd.addpoly(
x=0, # Center of the polygon in the x-direction
y=0, # Center of the polygon in the y-direction
z=0, # Center of the polygon in the z-direction
vertices=vertices, # Vertices of the polygon
material="Si (Silicon) – Palik",
name="adiabatic_taper_polygon"
)
fdtd.addtogroup("::model::Taper")
fdtd = lumapi.FDTD()
fdtd.selectall()
fdtd.delete()
# Parameters for the adiabatic taper
wavelength = 1550e-9 # Operating wavelength in meters
width_input = 0.5e-6 # Width of the input waveguide in meters
width_output = 0.075e-6 # Width of the output waveguide in meters
alpha = 1 # Slope angle in degrees
lambda_0 = 1550e-9 # Center wavelength in meters
n_eff = 3.47 # Effective index of the cross-section at the center of the taper
# Create the adiabatic taper
create_adiabatic_taper(fdtd, width_input, width_output, alpha, lambda_0, n_eff) I would like to write a code that can implement the equations of this paper: Adiabatic operation slope-loss algorithm for ultrashort and broadband waveguide taper
I tried it in python but it did not improve my coupling efficiency at all, mayba I am doing something wrong… Here it is my python code:
import sys
sys.path.append(r"C:Program FilesLumericalv241apipython")
import lumapi
import numpy as np
def create_adiabatic_taper(fdtd, width_input, width_output, alpha, lambda_0, n_eff):
# Define the number of segments to approximate the adiabatic taper
num_segments = 100
L_i_segments = np.zeros(num_segments)
# Widths for each section
widths = np.linspace(width_input, width_output, num_segments + 1)
vertices_x = []
vertices_y = []
for i in range(num_segments):
W1 = widths[i]
W2 = widths[i + 1]
W0 = (W1 + W2) / 2
epsilon = 1e-10 # Small value to prevent division by zero or very small numbers
theta = alpha * lambda_0 / (2 * (W0 + epsilon) * n_eff)
# Prevent theta from becoming too small
if np.abs(theta) < 1e-10:
theta = np.sign(theta) * 1e-10
L_i = (W1 – W2) / (2 * np.tan(theta))
# Ensure L_i is not negative
if L_i < 0:
L_i = 0
L_i_segments[i] = L_i
if i == 0:
vertices_x.append(0)
vertices_y.append(W1 / 2) # For half width
vertices_x.append(sum(L_i_segments[:i+1]))
vertices_y.append(W2 / 2) # For half width
vertices_x = np.array(vertices_x)
vertices_y = np.array(vertices_y)
vertices_x_full = np.concatenate([vertices_x, vertices_x[::-1]])
vertices_y_full = np.concatenate([vertices_y, -vertices_y[::-1]])
vertices = np.vstack((vertices_x_full, vertices_y_full)).T
print("L_i_segments:", L_i_segments)
print("Vertices X:", vertices_x_full)
print("Vertices Y:", vertices_y_full)
# Create the polygon
fdtd.addpoly(
x=0, # Center of the polygon in the x-direction
y=0, # Center of the polygon in the y-direction
z=0, # Center of the polygon in the z-direction
vertices=vertices, # Vertices of the polygon
material="Si (Silicon) – Palik",
name="adiabatic_taper_polygon"
)
fdtd.addtogroup("::model::Taper")
fdtd = lumapi.FDTD()
fdtd.selectall()
fdtd.delete()
# Parameters for the adiabatic taper
wavelength = 1550e-9 # Operating wavelength in meters
width_input = 0.5e-6 # Width of the input waveguide in meters
width_output = 0.075e-6 # Width of the output waveguide in meters
alpha = 1 # Slope angle in degrees
lambda_0 = 1550e-9 # Center wavelength in meters
n_eff = 3.47 # Effective index of the cross-section at the center of the taper
# Create the adiabatic taper
create_adiabatic_taper(fdtd, width_input, width_output, alpha, lambda_0, n_eff) python, taper, coupling, matlab MATLAB Answers — New Questions
How to extend bus label to include subsystem name it originates from
I have multiple subsystems each with output bus.
Is it possible to modify the bus name to include the name of the subsystem it originates from, so the that the scope would display the bus element and the subsytem name?I have multiple subsystems each with output bus.
Is it possible to modify the bus name to include the name of the subsystem it originates from, so the that the scope would display the bus element and the subsytem name? I have multiple subsystems each with output bus.
Is it possible to modify the bus name to include the name of the subsystem it originates from, so the that the scope would display the bus element and the subsytem name? subsystems, bus labels MATLAB Answers — New Questions
how can i give input data of machine leaning model that has been changed to mex file to be deployed on raspberry pi?
,i have SVM model that has been trained by classfication Learner app and i have used matlab to coder to convert to mex file but i dont know how to pass input data when deploying to matlab to test the model on matlab using the matlab raspberry pi support tool .Most work that i see with proper exaples are of deep learning ,can anyone help with this .,i have SVM model that has been trained by classfication Learner app and i have used matlab to coder to convert to mex file but i dont know how to pass input data when deploying to matlab to test the model on matlab using the matlab raspberry pi support tool .Most work that i see with proper exaples are of deep learning ,can anyone help with this . ,i have SVM model that has been trained by classfication Learner app and i have used matlab to coder to convert to mex file but i dont know how to pass input data when deploying to matlab to test the model on matlab using the matlab raspberry pi support tool .Most work that i see with proper exaples are of deep learning ,can anyone help with this . machine learning MATLAB Answers — New Questions
Why do I receive UNSUPPORTED entries in the Network License Manager log file?
In my license server log file, I get UNSUPPORTED lines that look like the following:
9:54:20 (MLM) UNSUPPORTED: "Communication_Toolbox" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))
9:54:20 (MLM) UNSUPPORTED: "Data_Acq_Toolbox" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))
9:54:20 (MLM) UNSUPPORTED: "MATLAB_Report_Gen" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))In my license server log file, I get UNSUPPORTED lines that look like the following:
9:54:20 (MLM) UNSUPPORTED: "Communication_Toolbox" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))
9:54:20 (MLM) UNSUPPORTED: "Data_Acq_Toolbox" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))
9:54:20 (MLM) UNSUPPORTED: "MATLAB_Report_Gen" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327)) In my license server log file, I get UNSUPPORTED lines that look like the following:
9:54:20 (MLM) UNSUPPORTED: "Communication_Toolbox" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))
9:54:20 (MLM) UNSUPPORTED: "Data_Acq_Toolbox" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327))
9:54:20 (MLM) UNSUPPORTED: "MATLAB_Report_Gen" (PORT_AT_HOST_PLUS ) costecj1@COSTECJ1-WD2 (License server does not support this feature (-18,327)) MATLAB Answers — New Questions
Arc Length Continuation Method: Numerical Method
I am trying plot a curve (frequency vs amplitude) that has a (sn) birfurcation, and I am trying to write a code that would use the Arc Length Continuation to get the solve the nonlinear equations and get the (frequency response) curve (include regions where two solutions exist).
The methodology is as follows
Initialization and Initial Guess: Find an initial guess for a specific omega (parameter)
Residual Calculation: Using a function handle to calculate residuals, based on the nonlinear equation
Newton-Raphson Solver: Solves the nonlinear equation using the Newton-Raphson method.
Continuation Method: Continuation method uses the arc length continuation to trace the solution curve by extrapolating new guesses and solving using the Newton-Raphson method.
Arc Length Constraint: Ensures the next step in the continuation process is a fixed arc length from the current solution.
Plotting: Code for plotting the FRF is included but commented out because the code is incomplete
My issue is in the function called continuation–which continunes to solve for nSteps (number of steps), by calculating the new guess, and augemeniting the Jacobain to have the new constraint equation–I believe I have the correct(?) logic but my code is incorrect.
(I know there are straight-forward ways to obtain the FRF for the function defined in Analytic Equation, the reason I am testing it out on a straight-forward equation is to make sure it is running correctly.
Any pointers appreciated
clc; clear; close all
w = [0]; % Path-finding parameters,omega–w, for initial search; starting at 0 Hz
x0 = [0;0]; % Initial guess (x(1) is the solution to the cosine and x(2) is the solution to the sine)
nSteps = 1000; % Number of steps to continue forward on the curve
% Initialize q_val
q_val = zeros(length(x0)+1,1); %this is the solution vector, it will have [x(1); x(2); w]
% Find the residuals using the initial w and the equation
equation_f = @(x, w) equation(x, w); % Function to calculate the residuals for each forcing
[sol, iter] = nlsolver(equation_f, x0, w, 10e-10); % Using Newton-Raphson to solve the equation
q_val = [sol;w]; % Store solution and corresponding w
% Perform continuation–trace the solution curve by extrapolating new guesses and solving using the Newton-Raphson method.
continuation_combined(q_val, nSteps)
% Plotting the results
% w = q_val(3,:);
% a = sqrt(q_val(1,:).^2 + q_val(2,:).^2);
% plot(w, a); grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% CONTINUATION FUNCTIONS
function q_val = continuation_combined(q, N)
q_val = q;
for n = 1:N
xguess = 2 * q_val(:, end) – q_val(:, end-1); % Extrapolate a new guess for the solution
xguess = nlsolver(continuation_side(xguess), xguess); % Solve using the extrapolated guess
q_val = [q_val, xguess]; % Append the new solution
end
function new_q = continuation_side(q_val)
w = q_val(end); % Extract the current parameter value
x = q_val(1:end-1); % Extract the state variables
% Constants
k = 1; m = 1; c = 0.02; f0 = 1; F = [f0; 0]; kc = 0.5;
% Linear part of the equation
A = [k – w^2 * m, -c * w; c * w, k – w^2 * m];
% Nonlinear part of the equation
B = [x(1) * (x(2)^2 + x(1)^2); x(2) * (x(2)^2 + x(1)^2)];
% Residuals
R = A * x + 0.75 * kc * B – F;
% Arc length constraint
S = 0.01;
aa = norm(q_val(:, end) – q_val) – S;
new_q = [R; aa]; % Return the combined residual and arc length constraint
end
end
%%%%% ANALYTIC EQUATION (OBTAINED FROM HBM)
function [R] = equation(x, w)
% Constants
k = 1; m = 1; c = 0.02; f0 = 1; F = [f0; 0]; kc = 0.5;
% Linear part of the equation
A = [k – w^2 * m, -c * w; c * w, k – w^2 * m];
% Nonlinear part of the equation
B = [x(1) * (x(2)^2 + x(1)^2); x(2) * (x(2)^2 + x(1)^2)];
% Residuals
R = A * x + 0.75 * kc * B – F;
end
%%%%% NEWTON-RAPHSON SOLVER
function [sol, iter] = nlsolver(func, guess, w, errorbound)
% Initializations
norm_R0 = 1;
iteration = 0;
hj = 1e-8; % Step size
x = guess;
while norm_R0 > errorbound && iteration < 1000 % Either error bound satisfied or iteration hits max threshold for each point
R0 = func(x, w); % Evaluate the function at x (initial conditions)
J = zeros(length(x), length(x)); % Initialize the Jacobian matrix
for r = 1:length(x)
for c = 1:length(x)
ej = zeros(length(x), 1);
ej(c) = 1;
Ri = func(x + hj * ej, w); % Evaluate the function at x + hj * ej
J(r, c) = (Ri(r) – R0(r)) / hj; % Compute the Jacobian entry
end
end
x = x – J R0; % Update x using the Jacobian and function values
iteration = iteration + 1;
norm_R0 = norm(R0); % Update the norm of R0
end
sol = x;
iter = iteration;
endI am trying plot a curve (frequency vs amplitude) that has a (sn) birfurcation, and I am trying to write a code that would use the Arc Length Continuation to get the solve the nonlinear equations and get the (frequency response) curve (include regions where two solutions exist).
The methodology is as follows
Initialization and Initial Guess: Find an initial guess for a specific omega (parameter)
Residual Calculation: Using a function handle to calculate residuals, based on the nonlinear equation
Newton-Raphson Solver: Solves the nonlinear equation using the Newton-Raphson method.
Continuation Method: Continuation method uses the arc length continuation to trace the solution curve by extrapolating new guesses and solving using the Newton-Raphson method.
Arc Length Constraint: Ensures the next step in the continuation process is a fixed arc length from the current solution.
Plotting: Code for plotting the FRF is included but commented out because the code is incomplete
My issue is in the function called continuation–which continunes to solve for nSteps (number of steps), by calculating the new guess, and augemeniting the Jacobain to have the new constraint equation–I believe I have the correct(?) logic but my code is incorrect.
(I know there are straight-forward ways to obtain the FRF for the function defined in Analytic Equation, the reason I am testing it out on a straight-forward equation is to make sure it is running correctly.
Any pointers appreciated
clc; clear; close all
w = [0]; % Path-finding parameters,omega–w, for initial search; starting at 0 Hz
x0 = [0;0]; % Initial guess (x(1) is the solution to the cosine and x(2) is the solution to the sine)
nSteps = 1000; % Number of steps to continue forward on the curve
% Initialize q_val
q_val = zeros(length(x0)+1,1); %this is the solution vector, it will have [x(1); x(2); w]
% Find the residuals using the initial w and the equation
equation_f = @(x, w) equation(x, w); % Function to calculate the residuals for each forcing
[sol, iter] = nlsolver(equation_f, x0, w, 10e-10); % Using Newton-Raphson to solve the equation
q_val = [sol;w]; % Store solution and corresponding w
% Perform continuation–trace the solution curve by extrapolating new guesses and solving using the Newton-Raphson method.
continuation_combined(q_val, nSteps)
% Plotting the results
% w = q_val(3,:);
% a = sqrt(q_val(1,:).^2 + q_val(2,:).^2);
% plot(w, a); grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% CONTINUATION FUNCTIONS
function q_val = continuation_combined(q, N)
q_val = q;
for n = 1:N
xguess = 2 * q_val(:, end) – q_val(:, end-1); % Extrapolate a new guess for the solution
xguess = nlsolver(continuation_side(xguess), xguess); % Solve using the extrapolated guess
q_val = [q_val, xguess]; % Append the new solution
end
function new_q = continuation_side(q_val)
w = q_val(end); % Extract the current parameter value
x = q_val(1:end-1); % Extract the state variables
% Constants
k = 1; m = 1; c = 0.02; f0 = 1; F = [f0; 0]; kc = 0.5;
% Linear part of the equation
A = [k – w^2 * m, -c * w; c * w, k – w^2 * m];
% Nonlinear part of the equation
B = [x(1) * (x(2)^2 + x(1)^2); x(2) * (x(2)^2 + x(1)^2)];
% Residuals
R = A * x + 0.75 * kc * B – F;
% Arc length constraint
S = 0.01;
aa = norm(q_val(:, end) – q_val) – S;
new_q = [R; aa]; % Return the combined residual and arc length constraint
end
end
%%%%% ANALYTIC EQUATION (OBTAINED FROM HBM)
function [R] = equation(x, w)
% Constants
k = 1; m = 1; c = 0.02; f0 = 1; F = [f0; 0]; kc = 0.5;
% Linear part of the equation
A = [k – w^2 * m, -c * w; c * w, k – w^2 * m];
% Nonlinear part of the equation
B = [x(1) * (x(2)^2 + x(1)^2); x(2) * (x(2)^2 + x(1)^2)];
% Residuals
R = A * x + 0.75 * kc * B – F;
end
%%%%% NEWTON-RAPHSON SOLVER
function [sol, iter] = nlsolver(func, guess, w, errorbound)
% Initializations
norm_R0 = 1;
iteration = 0;
hj = 1e-8; % Step size
x = guess;
while norm_R0 > errorbound && iteration < 1000 % Either error bound satisfied or iteration hits max threshold for each point
R0 = func(x, w); % Evaluate the function at x (initial conditions)
J = zeros(length(x), length(x)); % Initialize the Jacobian matrix
for r = 1:length(x)
for c = 1:length(x)
ej = zeros(length(x), 1);
ej(c) = 1;
Ri = func(x + hj * ej, w); % Evaluate the function at x + hj * ej
J(r, c) = (Ri(r) – R0(r)) / hj; % Compute the Jacobian entry
end
end
x = x – J R0; % Update x using the Jacobian and function values
iteration = iteration + 1;
norm_R0 = norm(R0); % Update the norm of R0
end
sol = x;
iter = iteration;
end I am trying plot a curve (frequency vs amplitude) that has a (sn) birfurcation, and I am trying to write a code that would use the Arc Length Continuation to get the solve the nonlinear equations and get the (frequency response) curve (include regions where two solutions exist).
The methodology is as follows
Initialization and Initial Guess: Find an initial guess for a specific omega (parameter)
Residual Calculation: Using a function handle to calculate residuals, based on the nonlinear equation
Newton-Raphson Solver: Solves the nonlinear equation using the Newton-Raphson method.
Continuation Method: Continuation method uses the arc length continuation to trace the solution curve by extrapolating new guesses and solving using the Newton-Raphson method.
Arc Length Constraint: Ensures the next step in the continuation process is a fixed arc length from the current solution.
Plotting: Code for plotting the FRF is included but commented out because the code is incomplete
My issue is in the function called continuation–which continunes to solve for nSteps (number of steps), by calculating the new guess, and augemeniting the Jacobain to have the new constraint equation–I believe I have the correct(?) logic but my code is incorrect.
(I know there are straight-forward ways to obtain the FRF for the function defined in Analytic Equation, the reason I am testing it out on a straight-forward equation is to make sure it is running correctly.
Any pointers appreciated
clc; clear; close all
w = [0]; % Path-finding parameters,omega–w, for initial search; starting at 0 Hz
x0 = [0;0]; % Initial guess (x(1) is the solution to the cosine and x(2) is the solution to the sine)
nSteps = 1000; % Number of steps to continue forward on the curve
% Initialize q_val
q_val = zeros(length(x0)+1,1); %this is the solution vector, it will have [x(1); x(2); w]
% Find the residuals using the initial w and the equation
equation_f = @(x, w) equation(x, w); % Function to calculate the residuals for each forcing
[sol, iter] = nlsolver(equation_f, x0, w, 10e-10); % Using Newton-Raphson to solve the equation
q_val = [sol;w]; % Store solution and corresponding w
% Perform continuation–trace the solution curve by extrapolating new guesses and solving using the Newton-Raphson method.
continuation_combined(q_val, nSteps)
% Plotting the results
% w = q_val(3,:);
% a = sqrt(q_val(1,:).^2 + q_val(2,:).^2);
% plot(w, a); grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% CONTINUATION FUNCTIONS
function q_val = continuation_combined(q, N)
q_val = q;
for n = 1:N
xguess = 2 * q_val(:, end) – q_val(:, end-1); % Extrapolate a new guess for the solution
xguess = nlsolver(continuation_side(xguess), xguess); % Solve using the extrapolated guess
q_val = [q_val, xguess]; % Append the new solution
end
function new_q = continuation_side(q_val)
w = q_val(end); % Extract the current parameter value
x = q_val(1:end-1); % Extract the state variables
% Constants
k = 1; m = 1; c = 0.02; f0 = 1; F = [f0; 0]; kc = 0.5;
% Linear part of the equation
A = [k – w^2 * m, -c * w; c * w, k – w^2 * m];
% Nonlinear part of the equation
B = [x(1) * (x(2)^2 + x(1)^2); x(2) * (x(2)^2 + x(1)^2)];
% Residuals
R = A * x + 0.75 * kc * B – F;
% Arc length constraint
S = 0.01;
aa = norm(q_val(:, end) – q_val) – S;
new_q = [R; aa]; % Return the combined residual and arc length constraint
end
end
%%%%% ANALYTIC EQUATION (OBTAINED FROM HBM)
function [R] = equation(x, w)
% Constants
k = 1; m = 1; c = 0.02; f0 = 1; F = [f0; 0]; kc = 0.5;
% Linear part of the equation
A = [k – w^2 * m, -c * w; c * w, k – w^2 * m];
% Nonlinear part of the equation
B = [x(1) * (x(2)^2 + x(1)^2); x(2) * (x(2)^2 + x(1)^2)];
% Residuals
R = A * x + 0.75 * kc * B – F;
end
%%%%% NEWTON-RAPHSON SOLVER
function [sol, iter] = nlsolver(func, guess, w, errorbound)
% Initializations
norm_R0 = 1;
iteration = 0;
hj = 1e-8; % Step size
x = guess;
while norm_R0 > errorbound && iteration < 1000 % Either error bound satisfied or iteration hits max threshold for each point
R0 = func(x, w); % Evaluate the function at x (initial conditions)
J = zeros(length(x), length(x)); % Initialize the Jacobian matrix
for r = 1:length(x)
for c = 1:length(x)
ej = zeros(length(x), 1);
ej(c) = 1;
Ri = func(x + hj * ej, w); % Evaluate the function at x + hj * ej
J(r, c) = (Ri(r) – R0(r)) / hj; % Compute the Jacobian entry
end
end
x = x – J R0; % Update x using the Jacobian and function values
iteration = iteration + 1;
norm_R0 = norm(R0); % Update the norm of R0
end
sol = x;
iter = iteration;
end matlab MATLAB Answers — New Questions
Matlab Parallel pool test failure
I am using Matlab R2019b, I have setup an HPC cluster. In the validation stage, the last one (parallel pool test) fails. It shows the host IP refuses the connection. I tried some other IPs, still the same issue. Also, I have added the inbound rule in the firewall for Matlab and TCP ports 27370-27370.Also, on the left bottom corner of Matlab, starting parallel pool always fails too. I can also see my jobs sent to the HPC job manager, but I guess when the data coming back they are refused by my local IP.I am using Matlab R2019b, I have setup an HPC cluster. In the validation stage, the last one (parallel pool test) fails. It shows the host IP refuses the connection. I tried some other IPs, still the same issue. Also, I have added the inbound rule in the firewall for Matlab and TCP ports 27370-27370.Also, on the left bottom corner of Matlab, starting parallel pool always fails too. I can also see my jobs sent to the HPC job manager, but I guess when the data coming back they are refused by my local IP. I am using Matlab R2019b, I have setup an HPC cluster. In the validation stage, the last one (parallel pool test) fails. It shows the host IP refuses the connection. I tried some other IPs, still the same issue. Also, I have added the inbound rule in the firewall for Matlab and TCP ports 27370-27370.Also, on the left bottom corner of Matlab, starting parallel pool always fails too. I can also see my jobs sent to the HPC job manager, but I guess when the data coming back they are refused by my local IP. matlab MATLAB Answers — New Questions
please sanity check my function for calculating Kendall’s tau
Hi, I’m trying to make my own function for calculating Kendall’s tau in a practice purpose, although I know there is Matlab function ( corr(A, ‘type’, ‘Kendall’) ). But I get two different answers when I run the Matlab function and my function. I don’t know the reason…
Here are example verctors:
xx = [1 0 1 1 0 1];
yy = [0 1 1 1 1 0];
Matlab corr function gives me -0.5, but my own function below gives me -0.26667
function taua=myKendall(a,b)
%% preparations
a=a(:);b=b(:);
validEntryIs = ~isnan(a)&~isnan(b);
a=a(validEntryIs);b=b(validEntryIs);
n=size(a,1);
%% compute Kendall rank correlation coefficient tau-a
K = 0;
for k = 1:n-1
pairRelations_a=sign(a(k)-a(k+1:n));
pairRelations_b=sign(b(k)-b(k+1:n));
K = K + sum(pairRelations_a.*pairRelations_b);
end
taua=K/(n*(n-1)/2); % normalise by the total number of pairs
end%functionHi, I’m trying to make my own function for calculating Kendall’s tau in a practice purpose, although I know there is Matlab function ( corr(A, ‘type’, ‘Kendall’) ). But I get two different answers when I run the Matlab function and my function. I don’t know the reason…
Here are example verctors:
xx = [1 0 1 1 0 1];
yy = [0 1 1 1 1 0];
Matlab corr function gives me -0.5, but my own function below gives me -0.26667
function taua=myKendall(a,b)
%% preparations
a=a(:);b=b(:);
validEntryIs = ~isnan(a)&~isnan(b);
a=a(validEntryIs);b=b(validEntryIs);
n=size(a,1);
%% compute Kendall rank correlation coefficient tau-a
K = 0;
for k = 1:n-1
pairRelations_a=sign(a(k)-a(k+1:n));
pairRelations_b=sign(b(k)-b(k+1:n));
K = K + sum(pairRelations_a.*pairRelations_b);
end
taua=K/(n*(n-1)/2); % normalise by the total number of pairs
end%function Hi, I’m trying to make my own function for calculating Kendall’s tau in a practice purpose, although I know there is Matlab function ( corr(A, ‘type’, ‘Kendall’) ). But I get two different answers when I run the Matlab function and my function. I don’t know the reason…
Here are example verctors:
xx = [1 0 1 1 0 1];
yy = [0 1 1 1 1 0];
Matlab corr function gives me -0.5, but my own function below gives me -0.26667
function taua=myKendall(a,b)
%% preparations
a=a(:);b=b(:);
validEntryIs = ~isnan(a)&~isnan(b);
a=a(validEntryIs);b=b(validEntryIs);
n=size(a,1);
%% compute Kendall rank correlation coefficient tau-a
K = 0;
for k = 1:n-1
pairRelations_a=sign(a(k)-a(k+1:n));
pairRelations_b=sign(b(k)-b(k+1:n));
K = K + sum(pairRelations_a.*pairRelations_b);
end
taua=K/(n*(n-1)/2); % normalise by the total number of pairs
end%function correlation, kendall’s tau MATLAB Answers — New Questions
Why am I receiving an error when generating a Trial License?
I am trying to generate a Trial License through my MathWorks Account. I receive an error message that says:
"We are unable to offer you a Trial. If you believe you are receiving this message in error, please contact your local Customer Support Representative"
Why am I receiving an error when generating a Trial License?I am trying to generate a Trial License through my MathWorks Account. I receive an error message that says:
"We are unable to offer you a Trial. If you believe you are receiving this message in error, please contact your local Customer Support Representative"
Why am I receiving an error when generating a Trial License? I am trying to generate a Trial License through my MathWorks Account. I receive an error message that says:
"We are unable to offer you a Trial. If you believe you are receiving this message in error, please contact your local Customer Support Representative"
Why am I receiving an error when generating a Trial License? trial, license, error MATLAB Answers — New Questions
Unable to load a message catalog ‘signal:designfilt’. Please check the file location and format.
I have this line in my code , to make a lowpass filter:
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset
but I got the error bellow, if any one can help me.
Error using message/getString
Unable to load a message catalog ‘signal:designfilt’. Please check the file location and format.
Error in signal.internal.DesignfiltProcessCheck/getAllReqdPropertyNamesFromValidConstraintStr (line 386)
getString(message(‘signal:designfilt:UnrecognizedConstraintSymbol’,cCell{i})));
Error in signal.internal.DesignfiltProcessCheck/checkSpecifiedPropertiesAreValid (line 1037)
plist = getAllReqdPropertyNamesFromValidConstraintStr(obj,obj.FilterResponse,cstrs{idx})’;
Error in signal.internal.DesignfiltProcessCheck/identifyConstraintSetFromSpecifiedProperties (line 502)
[invalidPropMsg,invalidPropMsgId,errIdx,propertyNames] = checkSpecifiedPropertiesAreValid(obj,parseParams,cstrs);
Error in signal.internal.DesignfiltProcessCheck/checkConstraints (line 134)
[parseParams,~] = identifyConstraintSetFromSpecifiedProperties( …
Error in designfilt>parseAndDesignFilter (line 505)
[err,requestedResponse,parseParams] = checkConstraints(parserObj,filterType,propNames,propValues,inputValueNames);
Error in designfilt (line 213)
[err,requestedResponse,parseParams,h] = parseAndDesignFilter(inputParamValueNames, varargin{:});
Error in lowpass>designFilter (line 191)
opts.FilterObject = designfilt(params{:});
Error in lowpass (line 97)
opts = designFilter(opts);
Error in ECG_PQRST_Revised (line 33)
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with datasetI have this line in my code , to make a lowpass filter:
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset
but I got the error bellow, if any one can help me.
Error using message/getString
Unable to load a message catalog ‘signal:designfilt’. Please check the file location and format.
Error in signal.internal.DesignfiltProcessCheck/getAllReqdPropertyNamesFromValidConstraintStr (line 386)
getString(message(‘signal:designfilt:UnrecognizedConstraintSymbol’,cCell{i})));
Error in signal.internal.DesignfiltProcessCheck/checkSpecifiedPropertiesAreValid (line 1037)
plist = getAllReqdPropertyNamesFromValidConstraintStr(obj,obj.FilterResponse,cstrs{idx})’;
Error in signal.internal.DesignfiltProcessCheck/identifyConstraintSetFromSpecifiedProperties (line 502)
[invalidPropMsg,invalidPropMsgId,errIdx,propertyNames] = checkSpecifiedPropertiesAreValid(obj,parseParams,cstrs);
Error in signal.internal.DesignfiltProcessCheck/checkConstraints (line 134)
[parseParams,~] = identifyConstraintSetFromSpecifiedProperties( …
Error in designfilt>parseAndDesignFilter (line 505)
[err,requestedResponse,parseParams] = checkConstraints(parserObj,filterType,propNames,propValues,inputValueNames);
Error in designfilt (line 213)
[err,requestedResponse,parseParams,h] = parseAndDesignFilter(inputParamValueNames, varargin{:});
Error in lowpass>designFilter (line 191)
opts.FilterObject = designfilt(params{:});
Error in lowpass (line 97)
opts = designFilter(opts);
Error in ECG_PQRST_Revised (line 33)
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset I have this line in my code , to make a lowpass filter:
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset
but I got the error bellow, if any one can help me.
Error using message/getString
Unable to load a message catalog ‘signal:designfilt’. Please check the file location and format.
Error in signal.internal.DesignfiltProcessCheck/getAllReqdPropertyNamesFromValidConstraintStr (line 386)
getString(message(‘signal:designfilt:UnrecognizedConstraintSymbol’,cCell{i})));
Error in signal.internal.DesignfiltProcessCheck/checkSpecifiedPropertiesAreValid (line 1037)
plist = getAllReqdPropertyNamesFromValidConstraintStr(obj,obj.FilterResponse,cstrs{idx})’;
Error in signal.internal.DesignfiltProcessCheck/identifyConstraintSetFromSpecifiedProperties (line 502)
[invalidPropMsg,invalidPropMsgId,errIdx,propertyNames] = checkSpecifiedPropertiesAreValid(obj,parseParams,cstrs);
Error in signal.internal.DesignfiltProcessCheck/checkConstraints (line 134)
[parseParams,~] = identifyConstraintSetFromSpecifiedProperties( …
Error in designfilt>parseAndDesignFilter (line 505)
[err,requestedResponse,parseParams] = checkConstraints(parserObj,filterType,propNames,propValues,inputValueNames);
Error in designfilt (line 213)
[err,requestedResponse,parseParams,h] = parseAndDesignFilter(inputParamValueNames, varargin{:});
Error in lowpass>designFilter (line 191)
opts.FilterObject = designfilt(params{:});
Error in lowpass (line 97)
opts = designFilter(opts);
Error in ECG_PQRST_Revised (line 33)
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset lowpass, designfilter MATLAB Answers — New Questions
Segmentation Fault or “undefined symbol” error when using MATLAB Engine with RHEL or CentOS Linux
When I run this simple script using MATLAB Engine for Python on RHEL (or Centos) Linux, I get a Segmentation Fault.
import matlab.engine
eng=matlab.engine.start_matlab()
eng.sqrt(4.)
Sometimes, instead of a Segmentation fault, I get the following type of error.
"libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl"
How can I fix these errors when using MATLAB Engine with RHEL 7 (or Centos 7) Linux?When I run this simple script using MATLAB Engine for Python on RHEL (or Centos) Linux, I get a Segmentation Fault.
import matlab.engine
eng=matlab.engine.start_matlab()
eng.sqrt(4.)
Sometimes, instead of a Segmentation fault, I get the following type of error.
"libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl"
How can I fix these errors when using MATLAB Engine with RHEL 7 (or Centos 7) Linux? When I run this simple script using MATLAB Engine for Python on RHEL (or Centos) Linux, I get a Segmentation Fault.
import matlab.engine
eng=matlab.engine.start_matlab()
eng.sqrt(4.)
Sometimes, instead of a Segmentation fault, I get the following type of error.
"libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl"
How can I fix these errors when using MATLAB Engine with RHEL 7 (or Centos 7) Linux? MATLAB Answers — New Questions
Can we sort the variables of a table as per the values in a particular row.
I have this data. the last row (the one highlighted in blue) is the sum of all the values in each column. I want to re-arrange all the columns as per the descending values in this last row but I am unable to do so. I tried sort code and it did work for all other tables but I dont know why its not working for my data. Can anyone please help?I have this data. the last row (the one highlighted in blue) is the sum of all the values in each column. I want to re-arrange all the columns as per the descending values in this last row but I am unable to do so. I tried sort code and it did work for all other tables but I dont know why its not working for my data. Can anyone please help? I have this data. the last row (the one highlighted in blue) is the sum of all the values in each column. I want to re-arrange all the columns as per the descending values in this last row but I am unable to do so. I tried sort code and it did work for all other tables but I dont know why its not working for my data. Can anyone please help? tables, matrix, data sorting MATLAB Answers — New Questions
StandAlone Matlab app don’t show the points with the interection with the mouse
I am building an app in matlab app desing that the user needs to interact with the graph with a mouse and in the app designer appears the points like in the figure. But when I create the standAlone app, this interaction with the graph disappears. Does someone know how to solve it?I am building an app in matlab app desing that the user needs to interact with the graph with a mouse and in the app designer appears the points like in the figure. But when I create the standAlone app, this interaction with the graph disappears. Does someone know how to solve it? I am building an app in matlab app desing that the user needs to interact with the graph with a mouse and in the app designer appears the points like in the figure. But when I create the standAlone app, this interaction with the graph disappears. Does someone know how to solve it? appdesigner, standalone app, graph MATLAB Answers — New Questions