Respondida
How would I 'trim-the-fat' off of individual text files that are part of a loop?
" I'm going to have multiple files with arbitrary names, that need to be analyzed and concat[e]nated " Presuming this is relate...

alrededor de 7 años hace | 0

| aceptada

Respondida
Using the find function in a for-loop: Need to solve an error - "Unable to perform assignment because the left and right sides have a different number of elements"
find will return a variable number of outputs depending upon the inputs and you've written the code with the presumption of only...

alrededor de 7 años hace | 0

| aceptada

Respondida
Logic of find peaks function
As Adam says, the doc does explain... "When you specify a value for 'MinPeakDistance', the algorithm chooses the tallest peak i...

alrededor de 7 años hace | 2

| aceptada

Respondida
Selecting data from an imported table
Presuming the data array is variable array x and it's the first column to explore... x=xlsread('yourfile.xls'); ix=find(diff(x...

alrededor de 7 años hace | 0

Respondida
How to append new data to a box and whisker plot
d=dir('*_01.mat'); v=[]; for i=1:length(d) V=[v load(d(i).name)]; end V=cell2mat(V); boxplot(V) from what you've told u...

alrededor de 7 años hace | 0

Respondida
What exactly is going on with this code? I'm having difficulty understanding it
"If you set the directory to the three fiels linked, you'll process them in about 30 seconds." I did set breakpoint in debugger...

alrededor de 7 años hace | 0

Respondida
Mark max value and min value with red circle
[~,imx]=max(y); [~,imn]=min(y); hold on plot(x([imn;imx]),y([imn;imx]),'or') or as I was going to do originally as noted in ...

alrededor de 7 años hace | 2

| aceptada

Respondida
How to add non-numerical axis values in 3D scatter plots?
lbls=num2str([1 2 5 8 10].','%d:1'); % build char array of desired tick labels xticklabels(lbls) % and...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to add errorbars
You forgot to add hold on before calling errorbar so that wiped out the barplot and then each subsequent call to it also will ha...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to use cellstr() without losing whitespace character?
Try the new string class... s=string(your_char_array); If you must end up with cellstr() array, then cast that result. s=cell...

alrededor de 7 años hace | 0

Respondida
Time format printing too much
I presume your complaint is the range label automagically shown for datetime axes. Seems there should be a way for user to turn...

alrededor de 7 años hace | 1

| aceptada

Respondida
How to change the linewidth of the axes without affecting the linewidth of the legend box?
Use the two object handles to set their respective properties--although legend does inherit axes properties such as the linewidt...

alrededor de 7 años hace | 1

| aceptada

Respondida
Output argument "v" (and maybe others) not assigned during call to "Deflection_vmndangi".
None of the conditions will be met if you pass a vector as you have written the IF tests. IF is true iff (if and only if) all e...

alrededor de 7 años hace | 0

| aceptada

Respondida
plus/minus inside fprinf statement
pmchar=char(177); fprintf(['The measured volume of %fmm^{3} ' pmchar '%fmm^{3} is equal to\nthe specified volume of %fmm^{3} ' ...

alrededor de 7 años hace | 0

Respondida
How can I Write a code that will allow a vector of positive integers in x, as a user input, to evaluate the equation listed below.For odd numbers we will use the following equation
x= input('\nPlease input a 5 values in vector notation:'); b=nan(size(x)); % initialize to something isodd=mod(x,2...

alrededor de 7 años hace | 0

| aceptada

Respondida
Do functions listen to global variables under while loops (Stopping functions)
pressure = readDevicepressure while pressure == 0 (x, y, z) = function(move the pressure reader to x,y,z) end only re...

alrededor de 7 años hace | 0

| aceptada

Respondida
I am not getting the correct answer when using datetime function
>> datetime(43100,'ConvertFrom','excel') ans = datetime 31-Dec-2017 00:00:00 >> You tried converting from (yr,mo,day...

alrededor de 7 años hace | 1

| aceptada

Respondida
How do I determine which model fits my data the best?
I'd start by returning the second, optional gof (goodness of fit) output variable that contains Field Valu...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to display all decimal numbers for floating numbers?
I'll guess for homework Q? the answer is less esoteric than Walter's take... :) Yes, if you need more precision than the defaul...

alrededor de 7 años hace | 0

Respondida
how can I loop a repmat function over columns of matrix?
Rereading, I guess it's just r=cell2mat(arrayfun(@(v,w) repelem(v,w,1),v,repmat(w,1,3),'uni',0)); for each array v. Naming v...

alrededor de 7 años hace | 0

Respondida
How Do I Plotting in Time Domain?
>> format bank >> 10/22.59*17066 ans = 7554.67 >> 10 rev/22.59 rev/sec * 17066 samples/sec --> samples/10 rev...

alrededor de 7 años hace | 0

| aceptada

Respondida
Creating 2x2 matrix is slow
The attached profile specific lines constitute only 39% of the total so there's 61% elsewhere but the allocation issue using [] ...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to sum the intervals in matlab
v=[1000;800]; err=[0.5;-1.7]; intvl=[0 1;-2 -1]; intvN=[3;1]; newv=v.*[1+mean(intvl,2)/100]; Above yields >> newv newv = ...

alrededor de 7 años hace | 0

Respondida
sum of timetables for each months
totalvehicles=retime([buses;cars],'monthly',@sum);

alrededor de 7 años hace | 1

Respondida
Scatterplot with condition on another matrix
clr=[0 0 1; 0 0 0]; % blue, black RGB triplets c=clr((A>C)+1,:); % set which based on lookup scatter(A,B,[...

alrededor de 7 años hace | 0

| aceptada

Respondida
whats wrong with this if block?
(different_salts_available==1||2||3||4||5) is bad syntax for if in MATLAB. It results in testing the result of the logical exp...

alrededor de 7 años hace | 0

| aceptada

Respondida
How can we create two vectors have normally distributed random entries with zero mean?
>> uv=randn(1000,2); >> uv=uv/sqrt(sum(uv(:,1).*uv(:,2))); >> uv(:,1).'*uv(:,2) ans = 1.0000 >> mean(uv) ans = 0....

alrededor de 7 años hace | 1

Respondida
readtable not understood behaviour
You could make a textimportoptions object and use it with readtable but with the text file as text, I'd just scan it and then c...

alrededor de 7 años hace | 0

| aceptada

Respondida
Generate random Bistochastic matrix with zero diagonals
function a=bistochastic(a,tol) % return bistochastic matrix from input nonnegative matrix if nargin<2, tol=0.001; end s1=sum(...

alrededor de 7 años hace | 3

| aceptada

Respondida
undefined function 'isnan' for input arguments of type 'table'
Presuming the variables in data are named y and X, then nans = isnan(data.y) | (sum(isnan(data.X), 2) > 0); You have to select...

alrededor de 7 años hace | 0

Cargar más