Respondida
Save variable to .mat file
try this: save(strcat(Name,'_waviness'),'waviness')

alrededor de 3 años hace | 0

Respondida
How to reference points in time in a matrix?
a=[ 0 0 0 0] a=[a; 0 0 0 0] a=[a; 0 0 0 0] a=[a; 0 0 0 0] a=[a; 0 ...

alrededor de 3 años hace | 0

| aceptada

Respondida
Identifying missing values in matrices
try idx=~ismember(B,A) C=A(idx)

alrededor de 3 años hace | 0

| aceptada

Respondida
load data cell from Mat file from Matlab file
clearvars; clc; ss=load('matlab_t.mat','unnamed'); %% I would like this to be ss=[1;2;3] ss=ss.unnamed

alrededor de 3 años hace | 0

Respondida
How to make unfilled plot points?
Think you'll find it's due to the linewidth - change it to 1 and they shouldn't be filled. MarkerSize changes the size of the po...

alrededor de 3 años hace | 0

| aceptada

Respondida
rng() throwing error
Not really sure: only thing that springs to mind is something shadowing the Matlab function? what do get when you type: which ...

alrededor de 3 años hace | 1

| aceptada

Respondida
How to remove vectors values with restraints?
A = [ 0.1 0.2 0.4 0.6] B = [ 0.5 0.9 0.6 0.2] C=(A+B)<1 A=A(C) B=B(C) C = 1×4 logical array 1 0 0 ...

alrededor de 3 años hace | 0

Respondida
How to save the results of all iterations?
Something like this? R=1.1/100; %m k=1; %W/m.K rho=1100; %kg.m^3 Cp=4180; %J/kg.K h=2700; %W.m^2.K ...

alrededor de 3 años hace | 0

| aceptada

Respondida
For Loop Indexing exceeding array elements
First run of the loop you are overwriting the z vector with a scaler if k <= 1 z=5; mu = 0; On...

alrededor de 3 años hace | 0

Respondida
how to save the results obtained by a for loop repeated n times
AC = [100 2; 110 4; 105 3; 130 7; 120 5; 115 5; 115 3; 140 7; 110 9; 105 4; 110 3; 120 5 ]; A = 3; function [C] = Trend(A...

alrededor de 3 años hace | 0

| aceptada

Respondida
Multiplication of elements of matrix without using for loop
A.*B ans = 1.0000 1.0000 0.9999 0.2500 0.4000 0.4998 0.1400 0.2400 0.3333

alrededor de 3 años hace | 0

| aceptada

Respondida
Explanation of num2str(x) - '0'
num2str(x) - this converts the number to a string Once converted subtracting '0' subtracts the character code for 0 from all ...

casi 6 años hace | 1

Respondida
How do I display list of folder (as text file)
files=dir sprintf('%s \n',files.name) fName=input('choose file:','s')

casi 6 años hace | 1

| aceptada

Respondida
How to delete columns if there is'nt enough data?
prunedData = rmmissing(dataMatrix,2,'MinNumMissing',13)

casi 6 años hace | 0

Respondida
How to add a small random number to all values in a matrix
testMatrix=[1 2 3;4 5 6;7 8 9] noise=(rand(size(testMatrix,1),size(testMatrix,2))-0.5)./5 testMatrix=testMatrix-nois...

casi 6 años hace | 1

| aceptada

Respondida
Legend title only without marker and lines of data
Looks like the text position is consistently in the upper right (irrespective of range scale values) to me, but if you say you'v...

alrededor de 6 años hace | 0

| aceptada

Respondida
How do i make different matrices run through the same code?
If your 2D matrices are of the same dimension they can be combined into a single 3D matrix: D(:,:,1)=matrixA D(:,:,2)=ma...

alrededor de 6 años hace | 0

| aceptada

Respondida
Finding how mych values contain a specific number in a matrix
Whilst I can admire the brevity of Walter's code, I might be inclined to use a more 'conventional' alternative A=rand(100...

alrededor de 6 años hace | 0

Respondida
How would i store data into a vector
numElements=10; %Create 1x10 row vector filled with zeros rowVector=zeros(1,numElements) %Create 1x10 column vect...

alrededor de 6 años hace | 0

| aceptada

Respondida
Can I change the loop size inside the loop?
For loop conditions are set upon entering the loop and the only form of modification that can be made is to 'break' out of the l...

alrededor de 6 años hace | 0

Respondida
How can I write log(e) in MATLAB?
I assume you mean log10? In Matlab log is base e, so log(e)=1 x=log10(exp(1))

alrededor de 6 años hace | 2

| aceptada

Respondida
"Function definitions are not permitted in this context."
If you have a function in a script (allowed from R2016 onwards I think), it must go at the end, after all the script code

alrededor de 6 años hace | 0

Respondida
All possible pairs in a vector
nchoosek(A,2)

alrededor de 6 años hace | 1

Respondida
Matrix indexing - Picking columns
Do you mean this instead of your 1:5:end? 5:5:end If you explicitly also want column 1 the you could use [1 5:5:end]

alrededor de 6 años hace | 1

| aceptada

Respondida
How to run the code?
From the overview given by your link, the main function is: function [digest, MSG_PADDED] = image_hash(V_LEN,H_LEN,METH,IMG...

alrededor de 6 años hace | 0

| aceptada

Respondida
Function that pulls a name from a list at random but doesn't repeat
listNames={'a','b','c','d','e','f','g','n','h'} for iter=1:9 name=pick_name(listNames) end functio...

alrededor de 6 años hace | 0

| aceptada

Respondida
How to find a location of a specific value inside a matrices that is 26x7x101 of length
[~,loc]=ismember(matrixName,value) [i,j,k]=ind2sub([26,7,101],find(loc,1)) The above will find the first specified...

alrededor de 6 años hace | 1

| aceptada

Respondida
How do I print the common elements in a row vector?
use the logical vector to index the common values common=A(ismember(A,B)) if you have multiple values in A that are the ...

alrededor de 6 años hace | 0

Respondida
Check values under a certain threshold with an undefined window
A=[9 10 47 50 49 48 2 46]; mymax=max(A); % in this case mymax=50 mincondition=mymax*0.9; % mincondition=45 indexe...

alrededor de 6 años hace | 0

| aceptada

Respondida
How to process a subset of a matrix
matrixName(2,:)=matrixName(2,:)/2

alrededor de 6 años hace | 0

| aceptada

Cargar más