Respondida
using inverse hyperbolic functions cosh in matlab
"theoretically, I should get C=A" Not necessarily. x = -1.5:0.1:1.5; plot(x,cosh(x)) line([1 1],[1 cosh(1)],'Color','r','L...

más de 4 años hace | 1

| aceptada

Respondida
How do I extract and process data from multiple .csv Files?
path_name = 'C:\some\directory\where\your\csv\files\are'; files = dir(fullfile(path_name,'*.csv')); file_names = fullfile({fil...

más de 4 años hace | 1

| aceptada

Respondida
Why does my plot go blank when I run my program?
There is an error that occurs before the loop is entered: clear all; %#ok<CLALL> close all; L_0=7; L_1=3; L_2=7.5; ...

más de 4 años hace | 0

Respondida
How can I do the average difference of two dataset?
for date = 1:numel(L2_p181r040) % skip L2_p181r040(date) if L2_p181r040(date).SREF is empty if isempty(L2_p181r040(dat...

más de 4 años hace | 0

| aceptada

Respondida
column number extract using find function..
[~,idx] = ismember([500 1000 2000],[0 500 1000 1500 2000 2500])

más de 4 años hace | 0

Respondida
Shade or fill area between several lines in same plot (probability function was used for plotting)
One way is to use patch load('Florea_2.mat'); % annularrimx = xlsread('C:\Users\almha\Desktop\Rayan\Probability.xlsx'); % I ...

más de 4 años hace | 0

| aceptada

Respondida
odd and even functions
One thing you can do is to plot the function and visually inspect it: f = @(x)0.5*(sin(x)+abs(sin(x))); fplot(f,[-pi pi]) It ...

más de 4 años hace | 1

| aceptada

Respondida
This statement is incomplete. error
Seems ok as-is, but there are two extraneous pairs of parentheses (which would not cause the error you see) A=A/max(A, [], 'all...

más de 4 años hace | 0

Respondida
Is it possible to Join two dataset in malab? I imported a MATLAB file into MATLAB as a table and I have another set of data in form of an array in a separate variable .
"How do I merge the data to have them both in one table?" It depends on how what's in the array corresponds to what's in the ta...

más de 4 años hace | 0

Respondida
How do i write this or represent this on matlab editor , i am new to it
if 5-mod(G,5)<=2 G= 60 CG = G + 5-mod(G,5) else CG = ceil(G,1) end

más de 4 años hace | 0

Respondida
Accesing a field within a row of a data structure
The correct syntax for getting the User_ID of elements at indices Index of struct array DS would be M = [DS(Index).User_ID]; o...

más de 4 años hace | 0

| aceptada

Respondida
Create tables based on partial match in variable names in other table
It's not clear why you want to split a single table into 4 tables, but here's one way: T = readtable('m.xlsx'); head(T) match...

más de 4 años hace | 0

| aceptada

Respondida
Using plot with dates stored in a cell array
Here's one way to add 2000 to the years dates = {'1/22/20','1/23/20','1/24/20','1/25/20'}; new_dates = datetime(regexprep(da...

más de 4 años hace | 1

Respondida
substitue a matrix into another with some conditions
The method below may or may not be what you have in mind. If it's not, can you provide a more general example or two? A=[1 1;2 ...

más de 4 años hace | 0

| aceptada

Respondida
Multiple table input issues
Since lightlevels is a vector, and that vector might be different lengths for different files, it makes sense to store those vec...

más de 4 años hace | 0

| aceptada

Respondida
I am trying to calculate overall cost but it keeps ending on the starting line 'overallcost' and not running im not sure what im doing wrong.
It may be that one or more of TotalResidentialCost and the other "total cost" variables are undefined, because the corresponding...

más de 4 años hace | 1

| aceptada

Respondida
make dialogue box wait for previous figure to be closed
I = imread('END_OF_YEAR Gameboard.jpg'); f = figure(); imshow(I); uiwait(f); % wait for the image to be closed before procee...

más de 4 años hace | 0

| aceptada

Respondida
Not sure why my code isn't working. Please help
Assuming that's a script, then depending on your version of MATLAB, you might have to move the function definition to the end. ...

más de 4 años hace | 0

| aceptada

Respondida
How to reorder matrix from one column to MxN matrix
A = [1;2;3;4;5;6;7;8;9;10;11;12;13;14;15]; reshape(A,5,[]).' % reshape to 5x3, then transpose to 3x5

más de 4 años hace | 0

| aceptada

Respondida
What does [a,fs] = audioread(filename) do?
[a,fs] = audioread(filename) reads the audio file filename and returns the audio data as a and the sampling rate as fs. The nu...

más de 4 años hace | 0

Respondida
Why is not the second tag in the legend?
Store the line handles returned from boxplot and plot and use them to explicitly tell legend which lines to use: SOC_ = randn(1...

más de 4 años hace | 1

| aceptada

Respondida
Can the start position for ginput() crosshairs be chosen?
There is no option for that, as far as I can tell. However, you can make a copy of ginput.m (let's say you call it my_ginput.m ...

más de 4 años hace | 1

| aceptada

Respondida
Remove programmatically added checkboxes and replace them with new checkboxes
names=dir('*train*.mat');% identify files with 'train' in name r={names(:).name}.'; % Create an cell structure of names StrE...

más de 4 años hace | 0

| aceptada

Respondida
length(data.(ChannelFirst)) this worked for years, now it won't work WHY?
The error says "F5" is not a field of the struct data. Looking at the code, I can see that data.F5 doesn't get assigned if leng...

más de 4 años hace | 0

Respondida
Save figure in a subplot loop
for i=1:100 if rem(i-1, 5) == 0 f = figure; end sgtitle('WSPL zeitlicher Verlauf Modell D Teil 2'); ...

más de 4 años hace | 0

| aceptada

Respondida
matlab set loop conditons question
Break it into two parts maybe (but it's not clear what you want to happen when k is 1, 2, 4, or 5). for k = 1:6 if m...

más de 4 años hace | 0

| aceptada

Respondida
how i can Obtain the paraconjugate of a polynomial ?
p = [a b c]; % coefficients of original quadratic r = roots(p); % roots of original quadratic rpc = r-2*real(r); % roots of pa...

más de 4 años hace | 1

Respondida
array a=[8 6 7] adding 0:1 to the array. possible combination for array should be 2^3=8.
a=[8 6 7]; a+dec2bin(0:2^numel(a)-1)-'0'

más de 4 años hace | 1

| aceptada

Respondida
How do you average vectors in a cell array?
If they're really all row vectors of the same length like that, then: mean(vertcat(C{:})) where C is the cell array.

más de 4 años hace | 0

| aceptada

Respondida
multi-variable function, sum over one variable
Maybe something like this z = 1:3; t = 1:4; NN = 1:2000; % Evaluate f(z,t,n) for each element of NN, % storing all result...

más de 4 años hace | 0

Cargar más