Answered
Can't seem to figure out how to begin on this project: Drawing circular shapes from a function that is created by connecting points.
I would start by calculating the theta vector for a shape with n+1 (hint) dots from 0 to 2pi from theta you can calculate x and...

7 years ago | 0

Answered
Creating the Snake Game using a class
To understand whats happening, lets build a small class with a function or two: classdef run methods function sta...

7 years ago | 1

Answered
How can I create a new matrix by using existing values in a column?
B=[0.100;0.250;0.200;0.120;0.080;0.060;0.055;0.040;0.020]; n = length(B); % prepare indices idx = 0:(length(B)-1); % spl...

7 years ago | 1

Answered
How to add string to the beginning of each element in a string array?
strcat('Syl_', s1) ans = 1×4 string array "Syl_1" "Syl_2" "Syl_3" "Syl_4"

7 years ago | 2

| accepted

Answered
How do I filter my data points without using smoothdata?
Some smoothing methods rely on fitting a moving curve to a small window of your data (Savitzky–Golay, LOESS, etc.) The simplest...

7 years ago | 0

| accepted

Answered
columns data to reference rows data
you can use the values in A as indices for B if you translate to linear indices: A = [1,4,2,5,4]; B = [3, 5, 6, 3, 1; 4,...

7 years ago | 1

Answered
I need three lines on one graph
x=0:0.3:30; hold off; semilogy(x,exp(x)); hold on; semilogy(x,2*exp(x)); semilogy(x,10*exp(x));

7 years ago | 0

Answered
Checking/Counting values in a given Timewindow
I'm not sure what the ",5" stand for in your time frame, but you can do something like that: states = [1 1174 1175 2006 2007 28...

7 years ago | 0

| accepted

Answered
How to find all unique combinations of XxY and YxX matrix?
do you need the solutions of x*y, or the number of possible combinations? Well to calculate the solutions you can multiply a co...

7 years ago | 0

Answered
Can someone please help me answer this question, I have no idea what to do.
diff Calculates The Difference Between Every Two Adjacent Points In A Vector, Therfore, It's Output Is A Vector With A Length Sh...

7 years ago | 0

Answered
Simple question about scatter/data plots
Your best option is to change your RideData script into a function (see documentation about functions) and have that function re...

7 years ago | 1

| accepted

Answered
I have a text file which has one column and large number of rows with 1 or -1 as the values. I need to convert this into signed binary values(01 and 11). how should i update it?
two things your problem is that you read a string from the file but handled it like a number because a string is actually a ch...

7 years ago | 0

Answered
Counting the number of elements of a vector found between a range in another vector
If you keep your range data as two columns instead of strings you can easily do it et = data.entryTime(~isnan(data.entryTime));...

7 years ago | 1

Answered
Most "MATLABesque" way to create mutable nested key value structure
If you don't mind the parser restrictions on keys you can use structs, which are basically dictionaries you can access the val...

7 years ago | 1

| accepted

Answered
How to display a column vector row by row
arrayfun(@(x, i) disp(['x' num2str(i) ' = ' num2str(x)]),x,(1:numel(x))')

7 years ago | 0

Answered
How can I model conditionally defined exponential functions?
First of all, it's hard to get a good fit out of so little data points. Second, your data in the code example is not a simple e...

7 years ago | 1

| accepted

Answered
Monte Carlo technique for normally distributed random variable
sig = 1; % standard deviation mu = 100; % mean n = 10000; % number of values x = ( randn(n,1) * sig ) + mu; z = 5; % des...

7 years ago | 0

Answered
How to divide the column data into variable length?
a = rand(20,1); c = mat2cell(a, [5,4,3,6,2], 1);

7 years ago | 0

| accepted

Submitted


CommandChainer
Tool for chaining commands on objects or structures in a single line. Handy for running several operations in an anonymous funct...

7 years ago | 1 download |

0.0 / 5

Answered
How can I populate a csv file in a loop without overwriting it? I want to place each vector in a single row on each iteration. But my solution overwrites and creates a new csv each iteration.
Inside The Loop Don't Write To File And Populate A Matrix Instead. vector_imag(:,k) = imag_28(:); Then Write Everything To The...

7 years ago | 0

| accepted

Question


Anonymous functions behavior is weird
I encountered a weird behavior with anonymous functions take a look at this class: classdef object1 < handle properties ...

7 years ago | 1 answer | 0

1

answer

Answered
Accessing surrounding elements in an array
https://www.mathworks.com/matlabcentral/fileexchange/29330-neighbour-points-in-a-matrix

7 years ago | 0

Answered
How do I import a file containing both numbers and strings
txt = fileread('blah.dat'); lines = strsplit(txt, newline); x = regexp(lines, '[^ ]+', 'match'); items = cat(1,x{:}); A = st...

7 years ago | 1

Answered
Comparing elements of two matrices and returning the row numbers in which at least one element is the same
A=[1 5; 2 1; 3 3; 2 2; 1 2; 5 6]; B=[1 5]; flags = arrayfun(@(a) bsxfun(@(x,y) any(eq(x,y)),B,a), A); indexToDesiredRows = al...

7 years ago | 2

| accepted

Answered
How to creat a matrix by choosing a particular array from 100 data files.
Assuming those are text files formatted like you mentioned above a_x_y you can read the second array using text scan: xCell =...

7 years ago | 0

Answered
Plot 2D line graph for each column in separate box having with minor grids on
To Generate A Separate Box For Each Curvery You Can Use subplot function Which Creates A Grid Of Axes for i = 1:size(test,2) ...

7 years ago | 0

| accepted

Answered
Matlab Class property sharing between different classes
If you Trying Just copy the Property Value To Share The Value, That Can't Be Done Unless That Value Is A Third Handle Class cla...

7 years ago | 1

| accepted

Answered
Passing the input to another function
Try This One str2sym

7 years ago | 0

Answered
SIMPLE QUESTION : Partiation of data
A = Rand(2,600); There's The Simplest A1 = A(1:2,1:120); A2 = A(1:2,121:240); % And So On... You Can Automate With A Loop...

7 years ago | 0

Load more