Answered
Draw multiple circles in one image
R = 2:2:10 ; th = linspace(0,2*pi) ; figure hold on for i = 1:length(R) x = R(i)*cos(th) ; y = R(i)*sin(th) ; ...

4 years ago | 0

| accepted

Answered
Grouping or categorizing data based on conditions
How about this? data = readtable ('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1078835/Outpu.txt'); data = ...

4 years ago | 1

Answered
How to read several files
files_mat = dir('*.mat'); % your pwd is where mat files are present if not give path N_file=length(files_mat); % total numbe...

4 years ago | 0

Answered
Error using mesh Z must be a matrix, not a scalar or vector. Error in untitled6 (line 5) mesh(W,Y,Z)
As you have given single value of Z, it would be a line. w = 200:50:450; y=repmat(180,1,length(w)); [W,Y] = meshgrid(w,y); Z...

4 years ago | 0

| accepted

Answered
Sum structures with an array 1x1 each one
Q.O20 = 1; Q.B3 = 2 ; Q0h = Q.B3 + Q.O20 s = sum(cell2mat(struct2cell(Q)))

4 years ago | 0

| accepted

Answered
How to solve simultaneous equation with trigonometric function
You cannot write acos*(2*gamma) and tan*gamma. Note that they are function and they need someinput. It migh be: acos(2*gamma) an...

4 years ago | 0

| accepted

Answered
finding the maximum within a specific range
T =readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1075965/table.txt') ; NE8 = T.NE8 ; idx = NE8>200 ...

4 years ago | 0

Answered
How so subset observations in a matrix?
idx = FYEAR >= 2007 & FYEAR <= 2009 ; iwant_FYEAR = FYEAR(idx) ; iwant_GVKEYS = GVKEYS(idx) ;

4 years ago | 0

Answered
MATLAB fixing dates that are flipped
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1075635/Stacked.xlsx') ; t = datetime(T.(1))

4 years ago | 0

Answered
Drowsiness detect -- mouth dataset
How about this dataset? https://www.kaggle.com/code/adinishad/driver-drowsiness-using-keras/data

4 years ago | 0

Answered
Importing multiple data and assigning each columns into different variables
data = readtable("01_Angle.csv"); % or txt.data = importdata("01_Angle.txt"); data = table2array(data) ; You have each variab...

4 years ago | 0

| accepted

Answered
Add element inside cell with combination
A = {[],[1,2],[3,4],[5,6]} ; A = A(~cellfun('isempty',A)) ; % REmove empty cells [I{1:numel(A)}] = ndgrid(A{:}) ; thesum ...

4 years ago | 0

| accepted

Answered
n E Z => sin(n*pi) = -1 ?
n = vpa(100000000000000000000000000000) ; vpa(sin(n*pi))

4 years ago | 0

Answered
How to plot data from mutiple files in a loop so that all is collated in one figure?
data = cell(length(files),1) ; for k = 1:length(files) % Load data A = fullfile(Folder,files(k).name); dat...

4 years ago | 0

| accepted

Answered
the program is plotted once, then showing error, is something error in program
You initialize the value of y before for loop. y = zeros(1,n) ; y(1) = 0; func1 = @(y) ((-(s^2)*k/tc)*sin(y - pi/2) + L*(s^2...

4 years ago | 0

| accepted

Answered
Why is this error popping up for this script?
In the loop: i = 0; for v = v1:-0.001:v2 i = i + 1; v = v1:0.001:v2 %<---- this is empty matrix. P(i) = IsentCon...

4 years ago | 0

Answered
How to get coordinates of largest element in an array?
[val,idx] = max(RHSvec) ; [i,j] = ind2sub(size(RHSvec),idx') ; [i j]

4 years ago | 0

Answered
Statistical distribution comparison for two datasets
Plot histogram

4 years ago | 0

Answered
how to plot a line graph between a set of values against a single value
data = [-5 -7 0.81 -7 -4 0.96 -4 3 0.94 -1 6 0.87 5 -3 0.84 3 ...

4 years ago | 0

Answered
Working on an excel file
Don't use xlsread. Use readtable T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1071595/EXCEL.xls...

4 years ago | 0

Answered
Using switch to identify even or dd
@cgo You have only two options x can be either even or odd..that's all. x = 4 ; r = mod(x,2); if r == 0 fprintf('%d is...

4 years ago | 0

Answered
Take average of 1000 to be 100 values
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1071425/LEARN_users.txt') ; clc; T = readtable('h...

4 years ago | 0

| accepted

Answered
How do you rotate an ellispoid?
Proceed something like this: xc=50; %xCenter yc=50; %yCenter a=25; %xRad b=100; %yRad m = 1000; theta = linspace(0,2*pi,...

4 years ago | 1

| accepted

Answered
convert dates to specific format
t0 = datenum(today) % probably you have datenums t1 = datetime(datestr(t0)) % convert them to datetime t1.Format % check ...

4 years ago | 0

Answered
How to replace first and last element of each matrix in 7x1 cell with 0
for i = 1:length(cell) cell{i}(1)=0; cell{i}(end)=0; end

4 years ago | 0

| accepted

Answered
Different dimension matrix addition
Is this what you want? A = rand(2) ; B = rand(4) ; iwant = repmat(A,2,2)+B

4 years ago | 0

| accepted

Answered
Problem of reading file in triangle_display.m software
You may proceed like shown below. nodes = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1068640/aaa...

4 years ago | 0

| accepted

Answered
Create a slice by a code.
You may consider using this: https://in.mathworks.com/matlabcentral/fileexchange/7173-grabit Extract the points (xi,yi) you wa...

4 years ago | 0

Answered
I couldn't understand what's wrong in this.
The error is simple. You are trying to save more number of elements in LHS than it is initialized for. Demo A = zeros(1,3) ; ...

4 years ago | 0

Answered
Downsample and Upsample videos in matlab
Read video frame by frame, and use imresize on each frame.

4 years ago | 0

Load more