Community Profile

# Voss

Last seen: Today 2013 年からアクティブ

All

バッジを表示

#### Content Feed

How do i connect and running different loop at the same time?
Combine the two loops into one loop, so that they actually run at the same time: t = linspace(0,10,5); y = [ 3 2 1 4 5 ]; rud...

How to read matrix data in a loop
You already have all the data from all the files, stored in T1. You can remove this loop: for i = 1 : 327 { T1i}...

| 採用済み

how to create matrix c, where first column is vector a, and the last column is vector b without a loop
a = [1;2;3;4;5]; N = 3; c = a+(0:N)

I need to replace some values with NaN and some values with zeros
I've entered the values from your left-hand table into Excel and saved the attached xlsx file. Read the file into a matrix and ...

How do I make a randomized test on Matlab?
Use the 's' option in input to capture what the user types as a character array (as opposed to evaluating it), and use strcmp in...

| 採用済み

Efficient code for multiple string replace
You can store all those variables in a structure, and use dynamic field names. sec = ["T", "N"]; co = ["H","F"]; nco...

| 採用済み

Randomize vector avoiding consecutive values
Here's a method that picks values randomly, one at a time, from a set that excludes the most recently picked value leftSides = ...

1日 前 | 0

| 採用済み

Selecting a file to create a plot on MATLAB
uigetfile is the standard way to prompt the user to select a file. https://www.mathworks.com/help/matlab/ref/uigetfile.html

1日 前 | 1

How to change the label properties on geoxes?
ax = geoaxes(); ax.LongitudeLabel.String = 'Lon.'; ax.LatitudeLabel.String = 'Lat.'; ax.LongitudeLabel.FontSize = 20; ax.Lat...

1日 前 | 0

How does ismember and assert work in this code?
[ism,idx] = ismember(A,B(:,1)); returns ism, a logical array the same size as A saying whether each element of A is in B(:,1), ...

1日 前 | 0

| 採用済み

How to separate a column which has a comma separated values, into 2 different values?
city = ["Abilene, TX"; "Waco, TX"; "Arcata/Eureka, CA"]; t = table(city) city_state = split(t.city,", "); t.city = city_state...

1日 前 | 0

How to round values of table with mixed types?
If those columns that contain numeric values are cell arrays, as in FW = ["EVT64"; "EVT64"; "EVT64"]; SetTemp = {[400;225]; [2...

1日 前 | 0

global legend in subplot
That cane be done using tiledlayout instead of subplot. x = 1:10; y = 1:10; x1 = 1:10; y1 = 2:11; tiledlayout(3,7) for t...

2日 前 | 0

Click items in the legend to show or hide the associated line in plot
freq = 1:10; eps1 = rand(10,1); eps2 = rand(10,1); eps3 = rand(10,1); figure plot(freq,eps1); hold on; plot(freq,eps2);...

3日 前 | 1

| 採用済み

How to replace duplicate elements with the elements of the second array?
Maybe something like this? a = [23 34 56 78 100 10 12]; b = [2 2 2 4 6 0 0 11 11 11 6];% contains repeating elements yougo...

3日 前 | 0

| 採用済み

How to extract specific data from a .txt file
type FILE.TXT % show the contents of FILE.TXT, for reference data = readlines('FILE.TXT'); % read the file Here's one way to g...

3日 前 | 1

| 採用済み

one matrix that is made from multiple vectors of different lengths that don't start at the same point
Assuming data{1,10} is a row vector (i.e., the cell data(1,10) contains a row vector), then the following would work: M(10,5570...

3日 前 | 0

| 採用済み

reset pareto chart on App Designer
pareto creates a new axes and returns the two axes as the second output. You can store that new axes and cla(_,'reset') it along...

3日 前 | 0

Color in white only pixels defined by a matrix [rx2]
BW = imread('blobs.png'); imshow(BW) r1 = 163; c1 = 37; contour = bwtraceboundary(BW,[r1 c1],'W'); hold on plot(contour(:,...

3日 前 | 0

| 採用済み

Exponential approximation for vector input
vect = [-5.0000 -5.0000 -5.0000 1.0000 0.9000 0.8000 0.7000 -5.0000 -5.0000]; Using / (matrix right divisi...

3日 前 | 0

I have a list of objects in matrix A and object list and their corresponding masses in matrix B.Howto generate a matrix containing masses of objects present in orderof matrxA
A = ["C"; "A"; "E"; "F"; "I"] B = ["A", 1;"B", 34;"C" 56;"D" 32;"E",11;"F",8;"G", 7;"H",9;"I" 77] [ism,idx] = ismember(A,B(:...

3日 前 | 0

| 採用済み

x1 = cos(2*pi*4*t); , x2 = cos(2*pi*12*t), x3 = cos(2*pi*16*t), x4 = cos(2*pi*28*t) Plot the continuous-time waveforms x1(t), x2(t), x3(t) and x4(t) over a 1-second interval
t1 = linspace(start_time,end_time,number_of_samples) For example, to use 100 samples over a one-second interval starting at t =...

3日 前 | 0

How to break data in to groups using while loop?
"Is it possible to do this using a while loop?" matrix = [1 50 60 70 50 40 2 NaN 10 20 10 10 3 NaN 20 NaN NaN NaN ...

3日 前 | 0

How to break data in to groups using while loop?
matrix = [1 50 60 70 50 40 2 NaN 10 20 10 10 3 NaN 20 NaN NaN NaN 1 NaN 60 30 40 50 2 10 20 10 20 NaN 1...

3日 前 | 0

How to label the numeric values at the end of a stack in a stacked bar graph?
Something like this? Y1 = [1 2 0 4]; Y2 = [2 4 6 0]; Y = [Y1; Y2]; Bin = bar(Y,'stacked'); xt = get(gca, 'XTick'); set(gca...

3日 前 | 1

How can I save figures when created in a loop?
This won't work for a couple of reasons: sprintf('C:\my\directory\...\Count_missing_values%d.fig',S(k).name) backslash (\) is ...

3日 前 | 1

| 採用済み

Zoom in on a section of a graph
xlim([9.5 10])

5日 前 | 2

| 採用済み

How to define the location/position of a number in a specific cell array?
idx = find(cellfun(@(x)isequal(x,1),MY));

6日 前 | 0

data extract from array or vector
data = rand(96,1); % 96-by-1 column vector for ii = 1:12 subset = data(ii:12:end); % do something with su...

7日 前 | 1

Variables in for loop not updating in following iterations
The loop has only one iteration because N is a scalar for x=N To loop N times, you can use for x=1:N

7日 前 | 0

| 採用済み