Risposto
How to import exponent number from Excel column to MATLAB
x = readtable("2powx.xlsx") y = cellfun(@(a) sscanf(a, "%d^%d")', x.LSB, "UniformOutput", false) y = cell2mat(y) y = y(:, 1)....

quasi 2 anni fa | 0

Risposto
How to fit a gaussian distribution curve on a bar diagram?
p = [1/36,2/36,3/36,4/36,5/36,6/36,5/36,4/36,3/36,2/36,1/36]; xsum =[2,3,4,5,6,7,8,9,10,11,12] ; bar(xsum, p) mu = sum(p.*xsu...

quasi 2 anni fa | 0

| accettato

Risposto
Why do I get error when using a simple global variable?
Not sure what the code is trying to do. However, the error is due to the wrong usage of ( ) rather than global variables. glob...

quasi 2 anni fa | 1

Risposto
How can I plot direction of principal components in PCA
x = randn(4, 2); plot(x(:,1), x(:,2), 'ro', 'DisplayName', 'data'); axis equal; hold on p = pca(x); xc = mean(x); quiver(x...

quasi 2 anni fa | 0

| accettato

Risposto
Smoothing data with sgolay filter
framelen = 11; order = 3; % adjust these values smootheddata = sgolayfilt(z, order, framelen);

quasi 2 anni fa | 0

Risposto
Unrecognized function or variable 'sum'.
classdef question2 methods function q2a = l1qa(~,table) % clear sum; s...

quasi 2 anni fa | 0

| accettato

Risposto
I have a 2x2 matrix with values [0.5694 -0.8220; -0.8220 -0.5694] How do I plot this matrix?
x = [0.5694 -0.8220; -0.8220 -0.5694] heatmap(x); figure plot(x(:, 1), x(:,2)) % take 1st column as x and 2nd column as y (...

quasi 2 anni fa | 0

Risposto
Get the displacement component which is perpendicular to the triangle (finite element)
% In order to know the normal of triangle, you need the coordinated of % triangle postri = randn(3, 3) % x y z v = dif...

quasi 2 anni fa | 1

Risposto
Separating a timestamp into individual components
times = [ 20082009 21082009 22082009 23082009]; d = floor(times/1e6); m = mod(floor(times/...

quasi 2 anni fa | 0

Risposto
Suppress Window using System Command
cd("C:\Program Files\Bentley\Offshore\MAXSURF CONNECT Edition V23") cmd = "MaxsurfModeler64.exe display off" system(cmd)

quasi 2 anni fa | 0

| accettato

Risposto
plot graphs with a range
R = 2.303 * 8.314; T = 273 + 20; F = 96500; Eqv = @(z, Xout, Xin) ((R * T) / (z * F)) * log(Xout/Xin); fprintf("<Question 1:...

quasi 2 anni fa | 0

| accettato

Risposto
Scatter plot with mean for multiple groups
x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1136975/MATLAB_exampledata.xlsx"); x.Group = cate...

quasi 2 anni fa | 0

Risposto
Find the first value that is greater than or equal to and its corresponding value
data =[ 0.01 3 0.02 4 0.03 6 0.04 9 0.05 12 0.06 14 0.07 15 0.08 18]; idx = find(dat...

quasi 2 anni fa | 1

| accettato

Risposto
How can I insert many columns into a matrix at different locations efficiently?
%Create some "data" A = rand(100); %some random data col = randsample(100,15); A(:, col)=zeros(100,15); %some random columns ...

quasi 2 anni fa | 0

Risposto
I am not sure why my function is undefined for input arguments double.
x = rand([-20 20]); % generate random number in range [-20 20] % call the function % output function_name input_argume...

quasi 2 anni fa | 0

| accettato

Risposto
How to get the intensity value of the flower
im = imread("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1136290/image.jpeg"); whos im = rgb2gray(im); ...

quasi 2 anni fa | 0

| accettato

Risposto
How to convert a sym variable to an ordinary variable?
t= linspace(-1,3); syms x_t(t); x_2(t) = piecewise(t<-1,(2),-1<t<=-.5,(t.*4+6),-.5<t<2, (-2.4*t+3),t==2,(2),t>=2, (2)); y ...

quasi 2 anni fa | 0

Risposto
how can I plot a trajectory of moving point ?
npts=1; v=28.8/3.6; radius=1000; center=[0 0]; MOVE(npts, v, radius, center) function MOVE(npts, v, radius, center) d...

quasi 2 anni fa | 0

| accettato

Risposto
can anyone help me ? i keep getting this error
num_roots=5; num_functions=6; %initial guess for roots (from Wolfram MathWorld) zeros_guess=[2.4,3.8,5.1,6,7.5,8.7;... 5.5...

quasi 2 anni fa | 0

| accettato

Risposto
Use a grid/image get positional inputs and measure time in-between clicks.
You can make your function based on ginput or getpts. Edit one of these matlab functions and add the output argument of t and r...

quasi 2 anni fa | 0

| accettato

Risposto
Having trouble calling a user defined function.
TableOne = array2table([1988*ones(10,1) randn(10, 2)]) TableTwo = array2table([1988*ones(10,1) randn(10, 2)]) %This complete...

quasi 2 anni fa | 0

Risposto
Volume formed by a moving triangle
% initial triangle p1 = [0, 0, 0]; p2 = [3, 0, 0]; p3 = [0 4 0]; % the velocity vector should be specified (instead of final t...

quasi 2 anni fa | 0

| accettato

Risposto
How could I sums up 1/n for n=1 to 10000?
It can be run as shown below. What problem have you encountered? n = 10000; % whatever you want sum_harm = 0; for i = 1:n ...

quasi 2 anni fa | 0

Risposto
i need series representation for the equation of erfc(x) and maching with it in plot
x = 0.5; format long erfc(x) for n=1:20 y(n) = erfc_by_series(x, n); end y' function y= erfc_by_series(x, n) ...

quasi 2 anni fa | 0

| accettato

Risposto
How to show that DFT follows N^2 number of operations?
One simple way is to plot sqrt(dft_time) vs n to see if it is a straight line. Generally speaking, the computation time can b...

quasi 2 anni fa | 0

| accettato

Risposto
Our professor calls this the connectivity array (but not referring to Matlab)
% [F G H ; % G I J; % H J F] % Then the 11x11 matrix should look like this: % [F G H 0 0 0 0 0 0 0 0; % G I J ...

quasi 2 anni fa | 0

Risposto
Numerical Double Integral in Matlab
It seems that the integration is separatable into two 1-D integrations: inner_term = W_t./b outer_term = a final_term = inner...

quasi 2 anni fa | 0

Risposto
Work with variable names in workspace that are mostly the same with a unique identifier at the end
clear;clc; %s = load('SampleData1.mat'); % load as a struct s = load('SampleData2.mat'); % figure out the varnam...

quasi 2 anni fa | 1

| accettato

Risposto
Splitting a sentence into an array of letters
str = 'I am happy' % characar array % the char array str is stored as [ 'I' ' ' 'a' 'm' ' ' 'h' 'a' 'p' 'p' 'y' %...

quasi 2 anni fa | 1

| accettato

Risposto
where can i find a complete list of table variable types?
% Create table LastName = ["Sanchez";"Johnson";"Zhang";"Diaz";"Brown"]; Age = [38;43;38;40;49]; Smoker = [true;false;true;fal...

quasi 2 anni fa | 1

Carica altro