답변 있음
Count number of nucleotide bases (letters) in file with multiple entries
% this is what the attached file contains: type file.txt data = readlines('file.txt'); ID = regexp(data(1:2:end),'>(.*?):...

3개월 전 | 0

| 수락됨

답변 있음
A simple/efficient way to add one additional xtick, and the corresponding xticklabel, to the existing xticks and xticklabels
plot(1:50) new_tick = 5; ax = gca(); ax.XTick = unique([ax.XTick new_tick]);

3개월 전 | 1

| 수락됨

답변 있음
Logging cmd in multiple diary
You can restore diary logging to log1.txt after logger2 finishes: logger1(); function logger1() logName = fullfile(pwd,...

3개월 전 | 0

답변 있음
I am having trouble constructing a 'for loop'. Can you suggest me on how to modify it?
One thing I notice is that (-A)^i-1 should be (-A)^(i-1) EDIT: that's now corrected in the question.

3개월 전 | 1

| 수락됨

답변 있음
Reading columns from a poorly-formatted text file
This file looks like a fixed-width file, but it's not quite, because lines 68 and 69 differ in format from the other lines. dbt...

3개월 전 | 0

| 수락됨

답변 있음
How to change Fontcolor xticks and yticks
Assuming you just want to change the color of the x-tick and y-tick labels: plot(1:10) ax = gca(); ax.XAxis.TickLabelColor ...

3개월 전 | 0

| 수락됨

답변 있음
Increasing the line width of box plot whiskers
findobj('Tag','boxplot') finds all* objects whose Tag is 'boxplot'. This includes any object whose Tag is 'boxplot' anywhere in ...

3개월 전 | 0

| 수락됨

답변 있음
I have some code that keeps failing to open and read two csv files out of four. Can someone explain what is wrong with either the code or the csv files
When processing Sample3.csv, post_fun removes every row of table T because index, defined here index = isnan(disp) | isnan(forc...

3개월 전 | 0

답변 있음
keyPressFcn on a figure: wait untill the user is done annotating.
Here is a code structure that you can run and add to. n_fig = 2; keyInfo = cell(1,n_fig); ii = 1; while ii <= n_fig ...

3개월 전 | 0

답변 있음
Scatter data to smooth line plot
load U_Au_T100 XY = Pos_UI1; scatter(XY(:,1),XY(:,2)) C = mean(XY,1); XY0 = XY-C; th = atan2(XY0(:,2),XY0(:,1)); [~,id...

3개월 전 | 1

| 수락됨

답변 있음
I need to compare elements that come from different tables
EQID_inter is a numeric array. Bnames_inter.Level is a cell array (whose first element contains the character vector '6000038')...

3개월 전 | 0

| 수락됨

답변 있음
Trying to understand how imagesc works compared to scatter.
load('imagesc_confusion.mat') Longitude (xlon) varies first in your data: [xlon ylat meantemp(:)] which means as you go down ...

3개월 전 | 2

| 수락됨

답변 있음
How can I add individual error bars to a grouped bar graph plot?
Replace x = reshape([b.XEndPoints],[nGroups, nBars]); with x = vertcat(b.XEndPoints); Example, using random data: x1 = [2.5...

3개월 전 | 0

| 수락됨

답변 있음
How to perform a basic division to every x1000 data columns?
load('S.mat') load('spikes_std_mtx.mat') Here is one way: N = size(spikes_std_mtx,2); result = NaN(N,1); for ii = 1:N ...

3개월 전 | 1

| 수락됨

답변 있음
Unique function to return last duplicate value
"The data is essentially a ramp up and then a 3 second pause then a ramp down and I want to [split] the data into two variables ...

3개월 전 | 0

| 수락됨

답변 있음
Error: unrecognized function or variable "bi2de"
bi2de is a function in the Communications Toolbox; based on the error message you received, I guess that toolbox is not installe...

3개월 전 | 0

| 수락됨

답변 있음
Creation of colorbar for given points
% I don't have your image data, so I make % a random matrix to use in imagesc() data = rand(20,20); % read colormap color...

3개월 전 | 0

| 수락됨

답변 있음
Plotting random number in a line
If you want to plot points on the x-axis, specify the y-coordinates as zero. X = rand(1,100); Y = zeros(1,100); plot(X,Y,'*')...

3개월 전 | 0

| 수락됨

답변 있음
slow drawing of a set of points on a plane
p = [ cos(0:.1:1.9*pi), -1:.2:1, 0*(-1:.2:1) ; sin(0:.1:1.9*pi), 0*(-1:.2:1), -1:.2:1 ] figure plot(p(1,:),p(2,:),'r.') grid ...

3개월 전 | 0

답변 있음
Issues with looping in structure: variable in the name
I guess this is something like your flight_data variable: flight_data = struct('fl',{permute(num2cell(rand(10,9,11),[1 2]),[3 1...

3개월 전 | 0

| 수락됨

답변 있음
too many open files even after adding fclose within my for loop
It may be that too many files are still open, coming from previous runs of the code where you did not have the fclose commands y...

3개월 전 | 0

| 수락됨

답변 있음
JOIN CVS FILES AND PLOT
fileDir = pwd; % current directory (or specify which one is the working directory) S = dir(fullfile(fileDir,'*.csv')); % get li...

3개월 전 | 0

| 수락됨

답변 있음
How to plot Mach Number Contours
Adding the line contourf(x,y,M) to the end of your code produces the following result: %% Initialize datapoint matrices clea...

3개월 전 | 0

| 수락됨

답변 있음
Don't understand the reason this code is giving me errors.
You have an extra ")" here: [t,q] = ode45(@(t,r) (G5*p*r-G6*p*p-G6*r*r)+m/Jy), [0 10],0); % ...

3개월 전 | 0

| 수락됨

답변 있음
how to change the direction of this code from right falling into left to left falling into right
figure x = 1:10; y = 10:-1:1; for ii = 1:numel(x) plot(x(ii),y(ii),'r.','markersize',40) axis([-1,11,-1,11]) p...

3개월 전 | 0

답변 있음
MEAN OF A VARIABLE WITH RESPECT TO OTHER VARIABLES
https://www.mathworks.com/help/matlab/ref/double.groupsummary.html

3개월 전 | 2

답변 있음
read part of a .txt file
filename = 'file.txt'; str = readlines(filename); C = arrayfun(@(s)sscanf(s,'%f %f %f %f %f %d:%d:%d %f'),str,'UniformOutput...

3개월 전 | 0

| 수락됨

답변 있음
read part of a .txt file
filename = 'file.txt'; T = readtable(filename,'CommentStyle','R','NumHeaderLines',0,'VariableNamingRule','preserve'); T(all(...

3개월 전 | 1

답변 있음
How does indexing work when sorting a matrix?
For matrix R, sort(R) sorts each column and indsort are row indices. To reproduce the sorted matrix, you can convert those row ...

3개월 전 | 1

답변 있음
Better way to keep dimensions using reshape from extracted struct array?
load('data.mat') bb = vertcat(myData.data.b)

3개월 전 | 2

| 수락됨

더 보기