Réponse apportée
Accessing variable in a table, depending on another variable
% Create a table: is_node = false(12); is_node(2,2) = true; is_node(4,2) = true; is_node(6,2) = true; is_node(10,2) = true;...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How do I substract like variables from each other
a = readmatrix("Book1.xlsx"); b = datetime(a(:,2),'ConvertFrom','excel'); N = size(a,1); c = duration(NaN(N,3)); for i = 1:N...

plus de 3 ans il y a | 0

Réponse apportée
I get this error, ive already checked parenthesis.Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error.
There is a comma missing: f = figure ('position', [0, 0] scrz(3),scrz(4)); % ^^ missing a comma ...

plus de 3 ans il y a | 0

Réponse apportée
Need help to plot frequency axis should be linear and cover the range 10 to 110 Hz in 1 Hz steps. Your vertical axis should cover from 0 to -40 dB
% File name: ee310 project.m clear all; close all; %Specify components. Rs=1000; C1=11.65e-6; C2=250.1e-9; C3=28.13e-6;...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
reshape matrix with diffrent size
load('vecteur.mat') % stored vecteur in a mat file, to avoid defining it in the code again here SI = scatteredInterpolant(vec...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Shift elements in a 3D array
Here's an example with a 2x3x2 array, removing all the 9s and appending 0s: data = reshape(1:12,[2 3 2]) siz = size(data); id...

plus de 3 ans il y a | 0

Réponse apportée
Which rows of a 2-column array contain elements of 1-column array.
ismember returns linear indices as its second output. You can use ind2sub to convert to row + column indices. a = [ 6208 ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Matlab menu sum values
clc msg = "Vyber hodnotu: "; vyber = ["-10000" "3000" "15000" "4000" "-6000"]; n = input("Počet pohybů na účtu: "); choice =...

plus de 3 ans il y a | 0

Réponse apportée
How to change scaling for different ranges of X-Axis inn figures?
Use set(gca(),'XScale','log') or semilogx.

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to plot a function F(a,b) having a matrix F (axb)
surf(phi,sigmap,syy)

plus de 3 ans il y a | 0

Réponse apportée
How can I change all numbers in matrix to 1? except for 0
One way: M = randi(4,[5 5])-2 % a matrix with zero and non-zero elements M(M ~= 0) = 1 % replace non-zero elements with ones ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Working with a cell of strings
Use string or cellstr. C = {"one";"two"} string(C) cellstr(C)

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Element-wise set operations
C = A == B.';

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Finite Element: Filling nxm matrix by extracting values from another nx1 matrix
V(2:5,2:5) = reshape(W,4,[]).';

plus de 3 ans il y a | 0

Réponse apportée
Finding slope for the polyfit line
polyfit returns the coefficients in a vector, with the highest-degree coefficient first. Therefore, the slopes are the values of...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
plotting 12 graphs in one figure
load data_matrix.mat data=SECTION_L; data(:,1:3)=[]; row=9; cleanup=data([1 2 3 row],:); % year range y1 = 1975; y2 = 201...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
how to create a new variable based off an if else statement on one variable?
t = table(["cats";"dogs";"cats";"sheep"],'VariableNames',"animals") all_animals = ["dogs" "cats" "sheep"]; [~,idx] = ismembe...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Can I use colormap to set color of my cumulative area chart in area()?
area dioesn''t use the figure's colormap directly, but it does use the axes' ''ColorOrder' by default, so maybe something like t...

plus de 3 ans il y a | 0

Réponse apportée
extract values from a table
It looks like, basically row 1 is year, row 2 is month, row 3 is day of month, and row 4 through the end are temperature data fo...

plus de 3 ans il y a | 0

Réponse apportée
indeHow to index values from a cell array
data =readtable('EURUSD=X.csv'); disp(data) G = floor((0:height(data)-1)/20).' + 1; DataE20 = splitapply(@(Date,Open,High,Low...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
how to use "randi" in specific case?
Maybe something like this (the example A requires at least 5 values, e.g., [10 15 20 25 30]): A = [ ... 0 0 1 0 0 0 0 0 0 ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to make certain indexes of a cell array empty?
pixelBlock{by + 1, bx + 1} = [];

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to initialize a table column to a character array?
% a table: filetext = table([1;2;3;4;5;6]) % append a column of all 'MET' on the right: filetext{:,end+1} = 'MET'

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Custom heat maps- How to highlight a specific value in the heatmap
Maybe one of the following two approaches will be useful, depending on exactly what you want to see. First, make up some data: ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to plot amplitude values of a matrix (dimension 651 by 10) with colorcode
How about this? load('amp.mat') load('cluster.mat') colors = 'gkcrw'; for ii = 1:5 idx = find(cluster == ii); pl...

plus de 3 ans il y a | 0

Réponse apportée
'This statement is incomplete' for a function with enough parameters
This error can happen when there is a syntax error within the function itself (not just the line defining the function signature...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Combining rows of each field within a structure
S = load('Combined_Structure.mat','ModOutRstance_interp_x_all'); new_struct = struct(); f = fieldnames(S.ModOutRstance_inter...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
why when i import an image from my desktop the error says it doesnt exist plz help and thank u in advance
Use both output arguments from uigetfile to construct the full path name of the file: [filename,pathname] = uigetfile(); ful...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
please can someone tell me what to do here what does it mean ? and does setappdata fall under a certain library i need to install for matlab plz help
setappdate(0,'filename',filename); % ^ this should be an "a". setappdata not setappdate

plus de 3 ans il y a | 0

Réponse apportée
Getting different values when indexing with islocalmax and find
The reason the elements of max_A_2 and max_A are not all equal has to do with how the results of indexing with a logical matrix ...

plus de 3 ans il y a | 0

Charger plus