Respondida
Apply transparent background to a figure
im_bw = imread('background.png'); im_pink = imread('background_pink.png'); % make an image of the pink background as-is: im...

casi 4 años hace | 0

| aceptada

Respondida
How to plot multiple scatter plot with regression line in one plot
Note that "lsline superimposes a least-squares line on each scatter plot in the current axes". That is, the second call to lsli...

casi 4 años hace | 0

| aceptada

Respondida
Access Data Within Structure Array
g = [1,3,5]; A = [90 89 88 87]; B = rand(4,2); C = 70; s.a = g; s.b = {A,B,C}; s.b{1}(2) Relevant documentation: https:...

casi 4 años hace | 2

| aceptada

Respondida
array with 1 and -1 - multiply coloums
Like this? M = [ -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 ...

casi 4 años hace | 1

| aceptada

Respondida
Represent the figures on the XZ (or YZ) plane
XY plane (current): plot3(CoordinateMatrix(:, 1), CoordinateMatrix(:, 2), current_z, '.'); XZ plane: plot3(CoordinateMatrix(...

casi 4 años hace | 0

| aceptada

Respondida
trying to plot 3 variables in 3d
clc clear all theta= linspace(.01, .55); %for thetamax = 32 degrees M=linspace(2,5); gamma=1.4; lambda3=sqrt((((M.^2)-1).^2...

casi 4 años hace | 0

Respondida
How does the matlab for loop work on a column vs. row vector of strings?
for iterates over columns, so if you give it a column vector, it iterates one time, with the loop variable taking the value of t...

casi 4 años hace | 0

Respondida
Finding the averages for a unique text value
Target_filepath = 'Eg data.xlsx'; [~,~,dat]=xlsread(Target_filepath) X = dat(2:end,[1 6]) mat = accumarray(findgroups(X(:,1...

casi 4 años hace | 1

Respondida
.TXT data into matrix Matlab
You might try using readtable. t = readtable('data.txt') plot(t.Var2,t.Var3)

casi 4 años hace | 0

Respondida
How to sort a complex vector with tie breaker angles between [0, 2π)?
How about adding pi to the phase (angle) of each number, sorting, then subtracting pi again (i.e., negate, sort, negate)? z = [...

casi 4 años hace | 0

Respondida
Find the points of the curve
base = [2450,2350,2250,2000,1800,1600,1550,1450,1600,1800,2000,2200,2400,2450,2400,2300,2350,2200 2300 2350 2300 2300 2250 2000]...

casi 4 años hace | 0

| aceptada

Respondida
I receive different output to like input
0:4+5*(0:4)' is the same as 0:(4+5*(0:4)') 0:(4+5*(0:4)') v+5*v', where v is 0:4, is the same as (0:4)+5*(0:4)' v = 0:4; v+5...

casi 4 años hace | 0

| aceptada

Respondida
How can I create a string scalar from a string array?
Use curly brace indexing on LigninName to get a character array: filenameconc = ['C:\Users\XXXX\', LigninName{1,i}, '_', num2st...

casi 4 años hace | 0

| aceptada

Respondida
Creating a custom axis
Set the xticks when you set the xticklabels (xticklabels by itself doesn't set the locations of the ticks, just their labels). A...

casi 4 años hace | 0

| aceptada

Respondida
Why am not getting any graph?
Do you mean for y1 to be calculated from x1, rather than from x? x1 = 0:20; y1 = (x1.^3 + c^2*x1.^2 - 10).*sin(x1); To answer...

casi 4 años hace | 0

| aceptada

Respondida
Unrecognized variable when using delimitedTextImportOptions
fecha would be a variable (i.e., a column) in the table datosccaas26122020, so the syntax would be: dies = datestr(datosccaas26...

casi 4 años hace | 1

| aceptada

Respondida
Add increasing values within an array
w=[1;2;3;1;2;3;1;2;3]; w_new = zeros(size(w)); w_new(1) = w(1); offset = 0; for ii = 2:numel(w) if w(ii) < w(i...

casi 4 años hace | 0

| aceptada

Respondida
Interpolate columns in matrix that contain NaN values
https://www.mathworks.com/matlabcentral/answers/1836353-interploate-between-rows-in-a-matrix-when-the-corresponding-columns-of-v...

casi 4 años hace | 0

| aceptada

Respondida
How do I make an entire row in a table NaN?
T{isOff,:} = NaN; % use curly braces {}

casi 4 años hace | 1

Respondida
Times table that takes a lo and hi values and makes lo to hi times table
lo = 6; hi = 12; n=lo:hi; x=(hi-lo)+2; sizeoftable=[0,(lo:1:hi)]; multiTable=zeros(x,x); multiTable(:,1)=[sizeoftable]; ...

casi 4 años hace | 1

Respondida
Creating a function similar to a sawtooth function
n = 17; max_val = 20; step_val = 5; m = max_val/step_val; temp = step_val*[0:m m-1:-1:-m -m+1:-1]; result = repmat(temp,1...

casi 4 años hace | 0

| aceptada

Respondida
Adding rows as a column
My guess: % matrix as in 1.png: data = reshape(1:21,3,[]).' % new columns to be added: new_data = (4:9)+3*(0:6).' % append ...

casi 4 años hace | 0

| aceptada

Respondida
change the position of each figure on the Z axis
clc; % Clear the command window. fprintf('Beginning to run %s.m ...\n', mfilename); close all; % Close all figures (except...

casi 4 años hace | 0

| aceptada

Respondida
datetime() does not return time data
Try specifying the Format (in addition to the InputFormat): DTstart = datetime("2021-11-16 11:48:00","InputFormat","yyyy-MM-dd ...

casi 4 años hace | 0

Respondida
how to remove an entire column in a cell array
ca = {'Name','Test1','Test2','Test3','Final'; 'A', 70 , 80 , 100, 99; 'B', 30 , 90, 95, 90; 'C', 100, 70, 8...

casi 4 años hace | 0

| aceptada

Respondida
i want to plot 4 craves but my code only plot three
cdf1 and cdf4 are almost the same: Nt = [1 1 4 4]; Nr = [1 4 1 4]; gammaBar = -10:1:0; SNR = 10 .^(gammaBar/10); H = sqrt...

casi 4 años hace | 1

Respondida
Turning a 1x3 vector into a three digit number
v = [1 5 6]; sum(v.*10.^(2:-1:0)) % or polyval(v,10)

casi 4 años hace | 0

Respondida
Need help on a problem
In a situation like this, where you have to repeat an operation a number of times but you cannot predict how many, it's convenie...

casi 4 años hace | 0

Respondida
Using a color scale on a plot
f = figure(); % use colormap parula because it goes blue -> yellow: cmap = parula(); % define the color limits: clim = [...

casi 4 años hace | 1

Respondida
Interploate between rows in a matrix when the corresponding columns of vector R_f with values ranging between 0 and 1 are less or equal to 0.5
load('R_f.mat') load('mat_up.mat') idx = abs(R_f) <= 0.5; mat_up(idx,:) % check old values mat_up(idx,:) = NaN; mat_u...

casi 4 años hace | 1

| aceptada

Cargar más